pngcheck
can detect non-PNGs:find -name '*.png' -exec pngcheck -q '{}' +
- GIMP GUI (unlike *Magick or Script-Fu, which are buggy) can properly convert to sRGB (remember to overwrite the original for each one):
- Open in GIMP (press Ctrl-C once it stops opening windows for a while):
find -name '*.png' -exec sh -c "pngcheck -v '{}' | grep -q 'chunk iCCP' && echo \"\\\"{}\\\"\"" \; | xargs gimp & while true; do window_id=$(wmctrl -l | grep -Pom 1 "^(0x[0-9a-f]{8})(?=\s.+ Convert to RGB working space\?$)"); if [ "$window_id" != "" ]; then xsendkey -window $window_id "Alt+C"; fi; sleep 1; done
- Convert and overwrite originals:
`wmctrl -l | grep -Po "^(0x[0-9a-f]{8})(?=\s.+ GIMP$)" | while read window_id; do echo Handling window $window_id; xsendkey -window $window_id Alt+i; xsendkey -window $window_id m; xsendkey -window$window_id c; until (wmctrl -l | grep -Poq "^(0x[0-9a-f]{8})(?=\s.+ Convert to ICC Color Profile$ )"); do sleep 1; done; wmctrl -l | grep -Po "^(0x[0-9a-f]{8})(?=\s.+