-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
0.32.5 - wrong color space / depth #3773
Comments
@lovell are you sure this is related to #3761 and v0.32.5? I am still on v0.32.4 and the following code correctly generates a 16bit sRGB PNG await sharp('test_p3-16bit.png')
.pipelineColourspace('rgb16')
.toColourspace('rgb16')
//.withMetadata({ icc: 'p3' }) //this reduces 16bit to 8bit
.resize({ width: 800, height: 800 })
.png({ progressive: false, force: true })
.toFile('test_out.png'); But as soon as withMetadata is uncommented, the output file will be an 8bit P3 PNG It also affects raw() output when I'm trying to use the workaround #2910 (comment) to strip the original exif data const { data, info } = await sharp('test_p3-16bit.png')
.pipelineColourspace('rgb16')
.toColourspace('rgb16')
//.withMetadata({ icc: 'p3' }) //this reduces 16bit to 8bit
.resize({ width: 800, height: 800 })
.raw() //trying to force { depth: 'ushort' } breaks output
.toBuffer({ resolveWithObject: true });
await sharp(data, { raw: info })
.pipelineColourspace('rgb16')
.toColourspace('rgb16')
//.withMetadata({ icc: 'p3' }) //this reduces 16bit to 8bit
.png({ progressive: false, force: true })
.toFile('test_out.png'); Interestingly when omitting |
@7freaks-otte You've run into libvips/libvips#3558, the fix for which will be included in the future libvips 8.15.0 (and therefore a future version of sharp). |
@lovell Thanks for the clarification, looking forward to seeing fixed this in the future. Any plans when this could arrive? |
I've applied the equivalent of the upstream libvips fix to sharp ahead of libvips 8.15.0 being made available as doing so also simplifies the fix for the original issue - see follow-up commit 9c217ab |
v0.32.6 now available, thanks for reporting. |
Hello, our code stoped working after upgrading from 0.32.1 to 0.32.5. I've found issue similar in previous versions
#3605
our code, relevant part
Expected result: image with 16bit color depth
Actual result: image with 8bit color depth
(input data are ofc the same, image with 16bpc)
I think the function ".toColorspace('rgb16')" has some issues in recent version.
The text was updated successfully, but these errors were encountered: