Image color coding conversion

From Apoyar Wiki
Revision as of 06:22, 22 April 2024 by 223.233.83.241 (talk) (Created page with "- 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, c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

- 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 "{}"' {} \;