0

I am not able to get the BufferedImage object of a CMYK image. ImageIO.getInstance(imgLocation) is giving an Exception for CMYK images.

My intention is to compress a CMYK type image and print it in PDF. Everywhere i find suggestions to convert CMYK images to RGB and compress, but the conversion is brightening the image. Any solution to reduce the size of generated PDF with CMYK image would be helpful.

iceman
  • 13
  • 5
  • possible duplicate of [Problem reading JPEG image using ImageIO.read(File file)](http://stackoverflow.com/questions/2408613/problem-reading-jpeg-image-using-imageio-readfile-file) – Oleg Estekhin May 23 '14 at 06:31
  • You can use my JPEGImageReader from https://github.com/haraldk/TwelveMonkeys. It converts to RGB by default, but you can also control the result to get the image with original CMYK colorspace. – Harald K May 23 '14 at 07:55
  • PS: Note that CMYK images contain 25% more information than RGB images, because of the extra color channel, and usually contains a (large) ICC profile. Because of this, a CMYK (YCCK) JPEG file will always be larger than the equivalent RGB (YCC) file. – Harald K May 23 '14 at 08:05
  • You can use the JpegReader class from [this answer](http://stackoverflow.com/questions/3123574/how-to-convert-from-cmyk-to-rgb-in-java-correctly). – Bahadir Tasdemir Sep 29 '16 at 13:04

0 Answers0