Open bburdette opened 8 years ago
I'm also experiencing this issue when resizing and writing jpgs. Any suggestions? This is a snippet from the code I'm having trouble with:
(defn image-resize [image width height]
(let [loaded-image (core/load-image image)
resized-image (core/resize loaded-image width height)
new-image-name (format-image-name image width height)]
(core/save resized-image new-image-name :quality 1.0 :progressive true)))
Might be related to this:
http://stackoverflow.com/questions/9340569/jpeg-image-with-wrong-colors
Don't really use JPEGs myself but happy to take a PR if anyone can work out what is going wrong...
I did some digging, and it looks like jpg colorspace is being converted from RGB to CMYK as the Java Image Writer lib adds an alpha channel. On save, it writes as CMYK because of the 4th channel. Could potentially be fixed by stripping that 4th channel before save:
https://github.com/rkalla/imgscalr/issues/82
Playing around with imagez today; this one-liner unexpectedly inverts the jpg colors.
source and result images attached:
Writing to PNG produces a normal looking image.