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

Make gAMA and cHRM fallback optional for sRGB #547

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

kornelski
Copy link
Contributor

The sRGB chunk is sufficient on its own, so it'd be nice to be able to skip writing gAMA/cHRM fallback. I don't think there's value in adding the fallback by default. I assume that decoders too old to understand sRGB chunk are also too old to have good color profile support, so passing through unlabelled sRGB pixels may be safer for them.

The fallback is still possible if someone sets the fallback values explicitly, but I haven't bothered to increase API surface for that.

set_srgb was inconsistent with set_source_gamma/chromaticities, so this change is backwards compatible.

@fintelia
Copy link
Contributor

fintelia commented Dec 9, 2024

The spec does say:

It is recommended that a PNG encoder that writes the sRGB chunk also write a gAMA chunk (and optionally a cHRM chunk) for compatibility with decoders that do not use the sRGB chunk.

That said, I'd be open to merging this since I agree with you that there probably isn't much software out there that understands gAMA/cHRM but not sRGB

@kornelski kornelski merged commit 4a1b982 into master Dec 9, 2024
24 checks passed
@kornelski kornelski deleted the gama-copy branch December 22, 2024 19:57
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.

2 participants