How to convert ps/eps file into jpg image file

If you want to convert a ps or eps file into jpg format on Linux, you can use ghostscript.

To install ghostscript on Ubuntu or Debian:

$ sudo apt-get install ghostscript

To install ghostscript on CentOS, RHEL or Fedora:

$ sudo yum install ghostscript

To convert ps or eps file into jpg format using ghostscript, run the following.

$ gs -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -dBATCH -dSAFER -r300 -sOutputFile=output.jpg input.eps

If you want to resize or rotate the generated jpg image file, you can use ImageMagick. A command-line utility called mogrify contained in ImageMagick package can do necessary image transformation.

To install ImageMagick on Ubuntu or Debian:

$ sudo apt-get install imagemagick

To install ImageMagick on CentOS, RHEL or Fedora:

$ sudo yum install ImageMagick

Once ImageMagick is installed, run mogrify command to resize and rotate an image.

$ mogrify -trim -resize 800x600 -rotate 90 myfile.jpg

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

Leave a comment

Your email address will not be published. Required fields are marked *

Current ye@r *