gpt4 book ai didi

java - 图片IO : cannot read image with CMYK color space

转载 作者:行者123 更新时间:2023-11-30 07:34:33 33 4
gpt4 key购买 nike

我在读取使用 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

有什么办法可以解决我的问题吗?

最佳答案

在 Java 中读取带有 CMYK 颜色的 JPEG 图像相当棘手。但是我已经发布了一个完整的解决方案 here .它还解决了深色变白的问题。

关于java - 图片IO : cannot read image with CMYK color space,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5089324/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com