OS X: creating or extracting preview(.jpg,.png) of .eps file

12,801

Solution 1

Like codelogic mentioned, sips is a good tool for this. However, it doesn't support EPS natively, so you need to convert to PDF first.

If you're on Tiger or Leopard, something like the following should work:

mkdir pdf jpg

cd pdf
echo ../eps/*.eps | xargs -n1 pstopdf
cd ..


sips -s format jpeg *.pdf --out jpg/

Assuming your EPS files are in the current directory, this will first convert them all to pdf, storing them in the pdf/ directory, then convert each PDF to a JPEG file in the jpg/ directory.

Solution 2

ImageMagick should be exactly what you're looking for. Once you have it installed, just use the convert utility:

convert file.eps -resize 25% preview.jpg  # create jpg thumbnail at 25% size

Solution 3

On OS X, you can use sips to perform image processing tasks, like thumbnailing. It should support EPS. If it doesn't, as Adam recommended there is ImageMagick's convert.

Solution 4

sips works fine in for me if I drop the trailing '/', i.e. output to jpeg rather than jpeg/

Share:
12,801
Ronn
Author by

Ronn

Updated on June 16, 2022

Comments

  • Ronn
    Ronn almost 2 years

    I'm using a mac and looking to batch convert a large amount of eps files and create jpg previews of each. I'm looking for preferably a command-line utility, or some type of workflow to easily batch a large number of files.

    Thanks for any ideas or input

  • Ronn
    Ronn over 15 years
    thanks soprano, this is exactly what I was looking for, only problem I'm having is how to write out the jpg to have the same name as the incoming pdf. can't seem to use the wildcard in the --out param
  • Sophie Alpert
    Sophie Alpert over 15 years
    I'm not sure quite what you mean. It should make a file with the same basename in the jpg/ directory.
  • Ronn
    Ronn over 15 years
    sips -s format jpeg *.pdf --out jpg/ would not work for me unless I specifically gave --out a filename, like whatever.jpg, otherwise I would get an error saying out_dir_not_found
  • Eli
    Eli over 10 years
    ImageMagick does not appear to support EPS natively. It relies on external programs like ghostscript: imagemagick.org/Usage/formats/#ps
  • Kyle Ridolfo
    Kyle Ridolfo about 8 years
    Worked great for me, did not need to change anything from the instructions.