-
-
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
Metadata/profile not retained when using .sharpen() (0.8.1) #125
Comments
I'll investigate, thanks for reporting this. |
The fast parameter-less convolution doesn't seem to be impacted so this problem only occurs when providing parameters to Technically the output from this module is designed to always be in the device-independent and web-friendly sRGB colour space so the output profile isn't really required. Could the real problem here be a JPEG image with a device-dependent RGB profile being reported as being in the device-independent "sRGB" space? If libjpeg says the colour space is The source for libjpeg says Any ideas here @jcupitt? |
At the very least will be useful investigating #125
Oh argh, you're right, it's a vips bug: $ vipsheader -a wtc.jpg | grep icc
icc-profile-data: VIPS_TYPE_BLOB, data = 0x16f7270, length = 3144
$ vips sharpen wtc.jpg x.jpg
$ vipsheader -a x.jpg | grep icc
$ Stupid thing. I'll fix it. |
Thanks John. Any thoughts on the RGB vs sRGB ambiguity that is libjpeg's |
None of the jpeg tags really mean anything, they predate ICC profiles and are redundant now. No one uses them, or they do, they are almost certainly setting them incorrectly. I think the best strategy is what web browsers do: if there's no ICC profile, it's sRGB; if there's an ICC profile, it's in device space and you should use the profile to generate pixels. libvips aims to handle colour like this. I think there are two sensible things sharp could do re. colour:
There's a lot of other metadata you can strip for even larger savings, IPCT data can be 40kb, for example. I expect sharp does this already. |
Perform sRGB conversion at end of pipe only withMetadata exports profile, should not convert Convert one fixture to sRGB to help test Discovered while investigating #125
Thanks @jcupitt, that's great advice. Prior to f57a0e3 this module was not importing the embedded profile for RGB images, which was a bug. It also now uses the input profile with the output if the @homerjam Are you able to test the latest master of both libvips and sharp to see if your problem is solved? |
Looks good! If you can use vips_icc_transform() it's a lot faster than separate import and export calls. lcms joins the two profiles together behind the scenes and makes a single transform directly between the device spaces. |
Yep, its working! I've trimmed some non-pertinent info, but the profile is there. It has a strange name in Photoshop though - it says Result here
|
Thanks for confirming James.
|
v0.8.1 now available via npm, thank you both for helping find and fix this problem. |
Since 0.8.1 the ICC profile is no longer retained when the
.sharpen()
method is usedThe text was updated successfully, but these errors were encountered: