This project has moved. For the latest updates, please go here.

Resizing an EPS file

Oct 17, 2014 at 9:16 PM
Edited Oct 17, 2014 at 9:45 PM
Hey guys,

I'm trying to resize an EPS file, and the result EPS has a bigger file size than the original one, so I was wondering if there is some kind of fix for this, thanks in advanced:
        var epsFile = @"C:\test.eps";
        var result = @"c:\upload\EPS\";
        MagickReadSettings settings = new MagickReadSettings();
        settings.Density = new MagickGeometry(72, 72);
        settings.ColorSpace = ColorSpace.sRGB;

        MagickNET.SetGhostscriptDirectory(@"c:\upload\EPS");
        using (var image = new MagickImage())
        {
            image.Read(epsFile, settings);
            image.Resize(2700, 2700);
            image.CompressionMethod = CompressionMethod.Zip;
            image.Write(result + "newEps.eps");
        }
PS: The original file size is: 483 KB and the result file is: 38,0 MB. So there is a big difference between the files.
Coordinator
Oct 18, 2014 at 12:36 PM
An EPS file is a vector image format. The output created by ImageMagick will always be in a raster format. That will always be larger. And there is no real need to resize a vector image. You can 'resize it' by specifying a different density when reading the image.
Oct 21, 2014 at 1:36 AM
Edited Oct 21, 2014 at 1:36 AM
Hey I was able to solved the problem using Ghostscript directly:
-q -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dNumRenderingThreads=4 -r72 -dDEVICEWIDTH=2700 -dDEVICEHEIGHT=2700 -dEPSFitPage -sDEVICE=epswriter -sOutputFile=OutputFileName originalFileName
Thanks for the help :)