I read through the usage documentation, and could not find any way to output an image X pixels wide, with the height determined by the aspect ratio. I have a large amount of EPS files I need to rasterize, and they need to be at least 2400px wide. My current workaround is to set a usually-high-enough resolution using the -r
flag, but this makes many of the images much, much larger than I need them to be.
I am currently using this command:
gs -dNOPAUSE -sDEVICE=pngalpha -dEPSCrop -sOutputFile=./result.png -r500x500 -dEPSFITPAGE -dBATCH -dQUIET ./input.eps
I have experimented with different combinations and settings of -g
, -dDEVICEWIDTH
, -dDEVICEHEIGHT
, -dFIXEDMEDIA
, -dFIXEDRESOLUTION
, and -dFitPage
, however I could not figure it out.
I have a feeling there may be some kind math needed to simply set the correct value for -r
that will yield the desired dimensions, but I'm not sure how to go about this. Any help appreciated!