Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert EPS to PNG and specify width/height

How to convert an EPS file to PNG and specify the size of the PNG?

convert file.eps -resize 800x1200 file.png

This converts the EPS but with the wrong dimensions

sample EPS file https://ufile.io/zrv3n

like image 400
clarkk Avatar asked Oct 20 '25 05:10

clarkk


1 Answers

Either ignore aspect ratio with !

convert file.eps -resize '800x1200!' file.png

Or resize to fill, and clip to size.

convert file.eps -resize '800x1200^' -gravity Center -extent 800x1200 file.png

Other techniques covered in Resize or Scaling article.

like image 71
emcconville Avatar answered Oct 22 '25 04:10

emcconville



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!