我正在使用Magick.NET使用以下代码将EPS文件导出为JPEG:
MagickReadSettings settings = new MagickReadSettings();
settings.ColorSpace = ColorSpace.sRGB;
settings.Format = MagickFormat.Eps;
using (MagickImage _image = new MagickImage())
{
_image.Read(image.Path, settings); //Loading the EPS
_image.Resize(3000, 3000); //The max size will be 3000px
_image.Density = new Density(300); //Setting DPI = 300
_image.Write("teste.jpg"); //Saving the EPS
}
结果太差了,我不知道为什么。使用_image.Write
之前需要配置一些东西吗?
通过Photoshop导出和Magick.NET导出查看结果:
Photoshop(2167x2322 300dpi):
Magick.NET(2800x3000 300dpi):
EPS文件的链接:https://ufile.io/hhokl
答案 0 :(得分:2)
要获得高质量,必须先设置文件配置,然后再通过MagickReadSettings
加载文件。
MagickReadSettings settings = new MagickReadSettings();
settings.ColorSpace = ColorSpace.sRGB;
settings.Format = MagickFormat.Eps;
settings.Compression = Compression.LosslessJPEG;
settings.Density = new Density(300);
using (MagickImage _image = new MagickImage())
{
_image.Read(image.Path, settings);
_image.Write("teste.jpg");
}