Keep imagemagick from making grayscale images from tiffs

Thanks! @afre - that explains a lot.

In case anyone needs to work with pngs, the png equivalent to "-type TrueColor " is “-define png:color-type=2”.

The context of my question regarding imagemagick and tiffs (and pngs) is trying to export png or tiff sidecars for GIMP-2.9 sidecar files. So moving on to my next question, over in this thread - A script to open a GIMP 2.9 XCF file and export a png - #9 by houz - @houz suggested using “find” as a way to recurse through folders to execute a command.

Having exported the “sidecars”, I want to process them to make them smaller both in dimension and in file size. So here’s the “find” commands I want to use:

  1. List the files output by the script to export tifs or pngs from XCF files - I modified the output name to distinguish between default GIMP XCF files and GIMP-CCE XCF files. This example uses tiffs:
    find . -name '*.CCE-xcf.tif' -exec ls -l '{}' \;

  2. Before resizing, convert all the tiffs to a linear gamma color space that’s large enough to encompass all colors that your monitor can show:
    find . -name '*.CCE-xcf.tif' -exec mogrify -profile /usr/share/color/icc/ClayRGB-elle-V4-g10.icc -type TrueColor '{}' \;

  3. Resize the tiffs to a convenient size for use in digiKam:
    find . -name '*.CCE-xcf.tif' -exec mogrify -resize 1024x1024\> -type TrueColor '{}' \;

  4. Convert the tiffs to a perceptually uniform color space:
    find . -name '*.CCE-xcf.tif' -exec mogrify -profile /usr/share/color/icc/AdobeRGB-elle-V4-g22.icc -type TrueColor '{}' \;

  5. To save disk space, convert the tiffs to 8-bits:
    find . -name '*.CCE-xcf.tif' -exec mogrify -depth 8 -type TrueColor '{}' \;

The first “find” comamnd is to make sure that the subsequent “find” commands will operation on the correct files. I suspect the last four “find” commands can be combined into one command - Suggestions regarding “how to” are very welcome!

@afre , @Morgan_Hardwood , or other imagemagick gurus - does my example resize command (3 above) completely bypass the imagemagick -resize option to apply a gamma “correction” of 0.45455? Because of course this gamma “correction” would be wrong given that I’ve already converted the image to a linear gamma RGB working space. Or do I need to add some other option to tell ImageMagick that the images are already in a linear gamma color space?