java ImageIO : 无法读取 CMYK 颜色空间的图像
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5089324/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ImageIO : cannot read image with CMYK color space
提问by FranckJS
I have a problem to read a specific jpeg image (CMYK color space) which have been created with ImageMagick :
我在读取使用 ImageMagick 创建的特定 jpeg 图像(CMYK 颜色空间)时遇到问题:
inputStream = new ByteArrayInputStream(bytesImage);
bufferedImage = ImageIO.read(inputStream);
//IIOException : unsupported image type
I tried to use JAI instead of ImageIO but it still doesn't work :
我尝试使用 JAI 而不是 ImageIO 但它仍然不起作用:
seekableStream = new ByteArraySeekableStream(bytesImage);
bufferedImage = JAI.create("Stream", seekableStream).getAsBufferedImage();
//Unable to render RenderedOp for this operation
Any idea to solve my problem?
有什么想法可以解决我的问题吗?
回答by Codo
回答by FranckJS
Since I have found my image has a CMYK color space, I have found a solution on stackoverflow : Problem reading jpeg image using imageio
由于我发现我的图像具有 CMYK 颜色空间,因此我在 stackoverflow 上找到了解决方案:使用 imageio 读取 jpeg 图像时出现问题
Now, the problem is the quality of my resulting image... dark colors became white...
现在,问题是我生成的图像的质量……深色变成了白色……