I need help to optimize an ImageMagick/ Powershell script with several additional components:
(The script is already complete, in a basic version. I've selected an analytics instead of a programming professional, because you need to be experienced with extracting data from jfif/jpg images to perform much of the below):
Components below will sit inside of the main Action. Please just worry about completing the components.
1) Create a script only to REDUCE images (if an image has its quality set too high, it may take an inappropriate amount of space. Therefore, I want to reduce incoming; Q=>=94 to Q=83.) (by viewing compression level by ImageMagick: Run from the command line: identify -format '%Q' yourimage.jpg . You get a value from 0 (low quality) to 100).
2) "Officially" determine the best final output method to save all exported images in, (using jpegtran/IM) for export to Web.
(err to the side of quality, and use all lossless compression techniques available.)
3) Losslessly convert all jpg (and PNG?) images to the smallest available (overwrite action).
( jpegcrush )
( or https://imageoptim.com/mozjpeg automation )
( or https://github.com/tjko/jpegoptim )
4) Remove ALL "Optional Markers" in the jfif/jpg "not" Exif.
5) Find images w/ a Quality setting of ~30% or below. Sort out to folder.
6) Find jpeg bit-depth "not" 8 bits/channel. Sort out to folder.
7) Find jpeg images ->Mode = Black/White. Sort out to folder.
8) Find jpeg images = Progressive
(jpeg images not in the RGB Mode (in PS (Image->Mode), the Mode can be set to RGB plus any of the following: Bitmap, Greyscale, DuoTone, Indexed, CMYK, Lab, or Multichannel: I would like to find all these.) Sort out to folder.
9) Find jpeg images with color profiles not RGB (and not empty). Sort to folder and append the Profile name to the beginning of filename.
10) Question/Answer: Can color space be determined by reading the image? (NOT the Exif)
11) Be able to port to new folders for these 'seven types': http://fileformats.archiveteam.org/wiki/JPEG#Types_of_JPEG_files .
12) Effect a side script for final export: add bytes to image data near end-of-file (not exif) to identify Self (Silhouette Graphics).
13) Find whenever non-image data is inserted in jfif/jpeg files: (such as merging: (DOS:) copy /b image.jpg + text.txt final.jpg, OR for the method used in 12., above).
14) Question/Answer: is Exif used for bmp or gif?
15) Effect a side script for Lossless rotate (if you know of a good utility that does this, that is fine!): load image, rotate, clear orientation bit, rewrite with updated/ removed Exif.