I know that RGB is for monitors and CMYK is for printing, but I want to work with CMYK without any conversions. I want to upload a CMYK image (jpeg) and print it. But when I used
com.sun.image.codec.jpeg.JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(is);
return decoder.decodeAsBufferedImage();
I got an inversed colors image. How can I get the same image in CMYK?
Asked
Active
Viewed 2,864 times
0

Filosssof
- 1,288
- 3
- 17
- 37
-
Where did you get the `inversed colors image`, in paper (printed) or in your screen? – Eypros Sep 29 '14 at 08:09
-
I got it in my screen. – Filosssof Sep 29 '14 at 08:09
-
Maybe there is a way to store image in CMYK and to display it also in my screen (user should see what he uploads) in CMYK? – Filosssof Sep 29 '14 at 08:11
-
2refer to [that link](http://www.randelshofer.ch/blog/2011/08/reading-cmyk-jpeg-images-with-java-imageio/) – Muhammed Refaat Sep 29 '14 at 08:15
-
You can use my CMYK capable [JPEGImageReader](https://github.com/haraldk/TwelveMonkeys#jpeg). – Harald K Sep 29 '14 at 09:07
1 Answers
2
There reason your colors are inverted is that you have a special variant of a CMYK JPEG image, namely Adobe CYYK. The strange colors are due to an old Photoshop bug (CMYK values are inverted) that has now become a de-facto standard that's handled by most JPEG software (except Java).
A proper CMYK conversion (handling different variants, using proper color profile etc.) can be found in: https://stackoverflow.com/a/12132630/413337.