Set export of an EPS to JPEG in Magick.NET

3

I'm using the Magick.NET library to convert an EPS file > JPEG. However the result is not nice because regardless of the resolution (DPI) and size (Width and Height) that I put the image is pixelated and with the wrong colors ... Here is an example:

Image saved in Photoshop:

ImagesavedviaMagick.NET

Asavector,thecorrectonewouldbetosaveitinanydimensionwithqualitybutitisnotwhatishappening.HereisthecodeI'musing.

using(MagickImage_image=newMagickImage(image.Path)){_image.Resize(3000,3000);//Maiorlado=3000px_image.Density=newDensity(300);//SetDPI=300_image.Write("teste.jpeg"); //
}

Is there a setting or parameter that I should go through to improve this resolution and color correction so that it is EQUAL to EPS?

    
asked by anonymous 25.06.2018 / 20:28

1 answer

3

To get good quality, you need to configure the file before importing it through 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");
 }

New result:

    
25.06.2018 / 21:27