Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed an sRGB profile if PNG had an sRGB chunk #259

Merged
merged 1 commit into from
May 21, 2017

Conversation

kornelski
Copy link
Member

No description provided.

@kornelski kornelski merged commit 216ccd6 into mozilla:master May 21, 2017
int has_profile = 0;

if (has_srgb_chunk) {
/* PNG can declare use of an sRGB profile without embedding an ICC file, but JPEG doesn't have such feature */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

JPEG doesn't have such feature

Not entirely true. Unfortunately, both latest Firefox and latest Chrome won’t recognise it properly (Safari does AFAIK), so it’s not safe to use it in output images instead of real ICC profiles. Ingestion tools (like e.g. cjpeg, ImageOptim) should be ideally aware of it in input imagery, though.

Copy link
Member Author

@kornelski kornelski Jul 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That other method requires parsing EXIF, and Adobe's take on it is especially complex (with absolute offsets embedded in TIFF tags), so I'll pass.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Adobe’s not a problem, I think, as when files leave it (or originate in it) – a real profile is always embedded (unless user decides otherwise). Problem with colour described in just DCF is with cameras set to AdobeRGB (luckily: never a default). I blame Canon, Nikon et al. And then – Mozilla and Google for not recognising it (can’t claim not knowing about it). Can’t really expect open tools to be correct when both GM and IM are oblivious to it :sadpanda:.

@kornelski kornelski deleted the pngtiny branch July 7, 2017 09:22
xinyu391 pushed a commit to xinyu391/mozjpeg that referenced this pull request Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants