-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
Color profiling issue #88
Comments
Hi, your source jpg is CMYK colortype, jimp and the underlying pngjs only support RGB and RGBA colortype. I don't know, if there are plans to support additional colortypes. |
Hi Skoah, Do you know any package which is good for ascertaining the Color Space "CMYK". I tried multiple options but none works consistently. I don't want to install any package like GM. If it is some JS only package, it should be good. Thankyou, |
Hi Manik, There is color-js, which I never used but it does not support cmyk I think. I don't think there is a good solution but Graphics-/ImageMagick for color space conversion and color profile management / conversion, at least not JS-only. Regards |
Yes. Looks like colour space is the culprit again. But this issue is stark compared to here: #84 The best place to deal with this is at the jpeg-js library, which does the reading/writing of JPEGs (Jimp just pushes pixels around): https://github.com/eugeneware/jpeg-js |
Hi Oliver / Skoah, I got an interim solution to it. I used npm package sharp (https://www.npmjs.com/package/sharp) to extract the color space data. I am not Jimping the images with color space "CMYK". I have raised the issue with jpeg-js library as well jpeg-js/jpeg-js#13 Thanks for your help. Truly appreciate. |
Hi Manik, good to see that you found a solution. Maybe in the future there is a pure js solution for this. Regards |
I've submitted a pull request that fixes this issue in jpeg-js. I used a smaller version of your image (which displays the same behavior in jimp right now) as one of the test cases there. If you want to test it yourself before that PR gets merged and released, and then jimp has another release cycle, you can play with it by making this change to your own local dependency: https://github.com/eugeneware/jpeg-js/pull/16/files#diff-f8ef8b8e3a0bcafb6e68ba4a7051a503 If you're curious to try it on the web, I've built the browser demo of jimp with that change. Yesterday, your test image looked like a black rectangle. Today, it works! Yesterday:Today:Demo |
Thankyou Stranded City for your help. This is a great improvement. Can we have a solution for Image colors getting lost as well. |
You mean color profiles? That's harder. The black and white image there is just part of the web-browser demo. The image is read into Jimp in full CMYK. If you modify your local copy of jpeg-js according to https://github.com/eugeneware/jpeg-js/pull/16/files#diff-f8ef8b8e3a0bcafb6e68ba4a7051a503, Jimp will work with CMYK jpegs. |
Fixed as of #125 by including jpeg-js/jpeg-js#16 @canvasmanager can you re-run your test with current code (v0.2.22) and let me know if you still see any issues? |
Happy days. This will be in the next release. Thanks all! |
I have ran Jimp resize on this image
![jimp_issue-orig](https://cloud.githubusercontent.com/assets/11734952/12271932/a95d4f6c-b983-11e5-9b41-031613ae61bf.jpg)
The image got converted into this one:
The text was updated successfully, but these errors were encountered: