我正在寻找支持CMYK格式(JPG或TIF)的图形库。我需要读取一个大图像文件和一个小图像文件,然后将第二个写入第一个。输出也必须是CMYK格式(不需要进行任何CMYK-> RGB转换)。有这样的库吗? (C# / C ++ / Java或其他什么语言)
(免责声明,我为Atalasoft工作) Atalasoft dotImage可以读取和写入CMYK格式图像,并在CMYK空间中执行叠加操作。
您需要使用以下代码来完成此操作:
public void OverlayCMYKOnCMYK(Stream bottomStm, Stream topStm, Point location, Steam outStm)
{
using (AtalaImage bottom = new AtalaImage(bottomStm, null), top = new AtalaImage(topStm, null)) {
// might want to check that both bottom and top have the same PixelFormat
// OverlayCommand will silently do conversions if they don't match.
OverlayCommand overlay = new OverlayCommand(top, location);
overlay.Apply(bottom);
bottom.Save(outStm, new TiffEncoder(), null);
}
}