我想使用CMYK颜色空间在java中编写一个图像,如下所示:
BufferedImage image= new BufferedImage(path.getBounds().width,
path.getBounds().height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = image.createGraphics();
color c = new Color(ColorSpaces.getDeviceCMYKColorSpace(), new float[]
{1.0f,1.0f,1.0f,1.0f}, 1.0f)
g2d.setPaint(c);
g2d.fill(path);
g2d.draw(path);
g2d.dispose();
Run Code Online (Sandbox Code Playgroud)
然后我使用imageIO将图像写入JPEG,但是,当转换为PDF时,生成的图像没有我在代码中提供的CMYK颜色,而是具有以下内容
我的问题是:
请注意,我已经尝试过EPS并且工作正常,但是,在我的项目的这个阶段,我觉得使用EPS感觉不舒服.