Changing the color profile value from 16-bit RGB to 8-bit sRGB resolves this issue.
This can be done with a single command in the terminal:
find . -type f -name '*.png' -print0 | while IFS= read -r -d '' file; do sips --matchTo '/System/Library/ColorSync/Profiles/sRGB Profile.icc' "$file" --out "$file"; done
Images can then be resized. For batch resizing, I use this command:
mdfind -0 -onlyin . "kMDItemPixelHeight > 600 || kMDItemPixelWidth > 600" | xargs -0 sips -Z 600
And upon completion, this command reduces the size of the image files:
find . -name '*.png' -exec pngquant --skip-if-larger --ext .png --force {} \; -exec xattr -c {} \;
source
share