mozjpeg icon indicating copy to clipboard operation
mozjpeg copied to clipboard

Optionally convert input images with attached ICC profiles to sRGB

Open njdoyle opened this issue 10 years ago • 2 comments

A nice feature to have would be the ability to specify that I would like any input image to cjpeg that has an attached ICC profile to be converted to sRGB and have the ICC profile stripped on output. This saves the (potentially many) bytes of the ICC profile being included with the output JPEG making an image that is effectively the same in the context of the web.

Current functionality seems to be that the ICC profile is simply passed through for JPEG input images (correct but wastes space) or that the ICC profile is completely ignored for PNG input images (producing incorrect output #191).

njdoyle avatar Nov 26 '15 19:11 njdoyle

Stripping profile might be quite bad because then the rendering of the resulting file is undefined. I've seen Firefox rendering the same image very differently when the sRGB profile was stripped out. I suggest adding a minimal sRGB profile like https://pippin.gimp.org/sRGBz/ instead.

magicgoose avatar Nov 25 '17 22:11 magicgoose

image very differently when the sRGB profile was stripped out.

Which is wrong behavior, w3c standards say that without any tags it must see it as sRGB. chromium does that. to fix it in firefox you must use gfx.color_management.mode set to 1.

I suggest adding a minimal sRGB profile like

There is only one profile from ICC (in version 2 and 4 though and now 5), all others are fake, any change in default primaries is wrong.

ValZapod avatar Jan 13 '21 11:01 ValZapod