我正在*.eps
使用 ImageMagick/Ghostscipt 处理所有文件并获取每个图像的颜色配置文件并显示结果。但对于灰度、RGB、CMYK,我得到的结果与 CMYK 相同。
我不知道我在哪里做错了,也不知道哪个属性会得到确切的结果。
C# 代码
namespace ConsoleApplication3
{
using System;
using System.IO;
using ImageMagick;
class Program
{
static void Main(string[] args)
{
foreach (var epsFile in Directory.GetFiles(@"c:\tmp\eps", "*.eps"))
{
using (var image = new MagickImage())
{
image.Read(epsFile);
Console.WriteLine("file: {0} color space: {1}", epsFile, image.ColorSpace);
}
}
}
}
}
预期结果
file: c:\tmp\eps\a.eps color space: CMYK
file: c:\tmp\eps\b.eps color space: CMYK
file: c:\tmp\eps\c.eps color space: CMYK
file: c:\tmp\eps\circle.eps color space: sRGB
file: c:\tmp\eps\d.eps color space: CMYK
file: c:\tmp\eps\e.eps color space: CMYK
file: c:\tmp\eps\f.eps color space: Grayscale
file: c:\tmp\eps\football_logo.eps color space: sRGB
file: c:\tmp\eps\fsu_logo.eps color space: sRGB
file: c:\tmp\eps\g.eps color space: CMYK
file: c:\tmp\eps\icam_logo.eps color space: sRGB
Press any key to continue . . .
但目前即将到来的结果是
file: c:\tmp\eps\a.eps color space: CMYK
file: c:\tmp\eps\b.eps color space: CMYK
file: c:\tmp\eps\c.eps color space: CMYK
file: c:\tmp\eps\circle.eps color space: CMYK
file: c:\tmp\eps\d.eps color space: CMYK
file: c:\tmp\eps\e.eps color space: CMYK
file: c:\tmp\eps\f.eps color space: CMYK
file: c:\tmp\eps\football_logo.eps color space: CMYK
file: c:\tmp\eps\fsu_logo.eps color space: CMYK
file: c:\tmp\eps\g.eps color space: CMYK
file: c:\tmp\eps\icam_logo.eps color space: CMYK
Press any key to continue . . .