Image color coding conversion
- To go through the path recursively, find all jpeg and png files and convert them to webp (leaving the original):
cd </folder/to/check/>
find . -name '*.jpg' -type f -exec bash -c 'cwebp -q 75 "$0" -o "${0%.jpg}.webp"' {} \;
find . -name '*.JPG' -type f -exec bash -c 'cwebp -q 75 "$0" -o "${0%.jpg}.webp"' {} \;
find . -name '*.png' -type f -exec bash -c 'cwebp -q 75 "$0" -o "${0%.jpg}.webp"' {} \;
- if it gives an error about the unsupported colour conversion, conver the jpg to RGB:
convert -colorspace RGB 2024Z_WE2_RDD_FR.jpg
- To find other images with CMYK colour coding:
cd </folder/to/check/>
find . -name '*.jpg' -type f -exec bash -c 'identify -format "%[colorspace]" "$0" | grep CMYK && echo "{}"' {} \;