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

keepIccProfile - 16-bit PNG with P3 profile input converted to AVIF output results in sRGB gamut #4008

Closed
uasan opened this issue Feb 26, 2024 · 3 comments

Comments

@uasan
Copy link

uasan commented Feb 26, 2024

Hello, I use.

await sharp(sourcePath)
.avif()
.keepIccProfile()
.toFile(targetPath);

Source image PNG (P3 profile)
image description

Result image AVIF (P3 profile)
image

Meta

{
  format: 'png',
  width: 1000,
  height: 1000,
  space: 'rgb16',
  channels: 4,
  depth: 'ushort',
  density: 72,
  isProgressive: false,
  hasProfile: true,
  hasAlpha: true,
  icc: <Buffer 00 00 02 24 61 70 70 6c 04 00 00 00 6d 6e 74 72 52 47 42 20 58 59 5a 20 07 df 00 0a 00 0e 00 0d 00 08 00 39 61 63 73 70 41 50 50 4c 00 00 00 00 41 50 ... 498 more bytes>,
  xmp: <Buffer 3c 3f 78 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 22 ef bb bf 22 20 69 64 3d 22 57 35 4d 30 4d 70 43 65 68 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 ... 14831 more bytes>
}

If use withIccProfile('p3') instead keepIccProfile() then the result is correct, what is the reason, is this a bug?

@lovell
Copy link
Owner

lovell commented Feb 26, 2024

This relates to #3906 - I've added the P3 fix via commit 75fedf1 - thanks for reporting.

@lovell lovell added this to the v0.33.3 milestone Feb 26, 2024
@lovell lovell changed the title keepIccProfile - avif incorect mixed colors keepIccProfile - 16-bit PNG with P3 profile input converted to AVIF output results in sRGB gamut Feb 26, 2024
@lovell
Copy link
Owner

lovell commented Mar 23, 2024

v0.33.3 now available with the fix, thanks again for reporting this.

@lovell lovell closed this as completed Mar 23, 2024
@uasan
Copy link
Author

uasan commented Mar 23, 2024

I checked, yes it works correctly in the new version, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants