CMYK 이미지 처리
File f = new File("/path/imagefile.jpg");
// Find a suitable ImageReader
Iterator readers = ImageIO.getImageReadersByFormatName("JPEG");
ImageReader reader = null;
while(readers.hasNext()){
reader = (ImageReader)readers.next();
if(reader.canReadRaster()){
break;
}
}
// Stream the image file (the original CMYK image)
ImageInputStream input = ImageIO.createImageInputStream(f);
reader.setInput(input);
//Read the image raster
Raster raster = reader.readRaster(0, null);
//Create a new RGB image
BufferedImage bi = new BufferedImage(raster.getWidth(), raster.getHeight(),
BufferedImage.TYPE_4BYTE_ABGR);
//Fill the new image with the old raster
bi.getRaster().setRect(raster);
[출처]
http://stackoverflow.com/questions/8118712/java-cmyk-to-rgb-with-profile-output-is-too-dark
'JAVA' 카테고리의 다른 글
[JAVA]DateUtil (0) | 2017.11.01 |
---|---|
[JAVA] context root path (0) | 2017.11.01 |
[JAVA] CmmProgramService 가져와 실행해 봅시다. (0) | 2017.11.01 |
[JAVA]ClassLoader2 (0) | 2017.11.01 |
[JAVA] ClassLoader (0) | 2017.10.30 |