ImageIO:无法读取 CMYK 色彩空间的图像
我在读取使用 ImageMagick 创建的特定 jpeg 图像(CMYK 颜色空间)时遇到问题:
inputStream = new ByteArrayInputStream(bytesImage);
bufferedImage = ImageIO.read(inputStream);
//IIOException : unsupported image type
我尝试使用 JAI 而不是 ImageIO,但它仍然不起作用:
seekableStream = new ByteArraySeekableStream(bytesImage);
bufferedImage = JAI.create("Stream", seekableStream).getAsBufferedImage();
//Unable to render RenderedOp for this operation
有解决我的问题的想法吗?
I have a problem to read a specific jpeg image (CMYK color space) which have been created with ImageMagick :
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 :
seekableStream = new ByteArraySeekableStream(bytesImage);
bufferedImage = JAI.create("Stream", seekableStream).getAsBufferedImage();
//Unable to render RenderedOp for this operation
Any idea to solve my problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Java 中读取具有 CMYK 颜色的 JPEG 图像相当棘手。但我已经在此处发布了完整的解决方案。它还解决了深色变白的问题。
Reading JPEG images with CMYK colors is rather tricky in Java. But I've posted a complete solution here. It solves the problem of dark colors becoming white as well.
由于我发现我的图像具有 CMYK 颜色空间,因此我在 stackoverflow 上找到了解决方案: 使用 imageio 读取 jpeg 图像时出现问题
现在,问题是我生成的图像的质量...深色变成了白色...
Since I have found my image has a CMYK color space, I have found a solution on stackoverflow : Problem reading jpeg image using imageio
Now, the problem is the quality of my resulting image... dark colors became white...