Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 432
Ronn Avatar asked Dec 31 '08 00:12

Ronn


3 Answers

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.

like image 26
codelogic Avatar answered Sep 19 '22 14:09

codelogic


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.

like image 124
Sophie Alpert Avatar answered Sep 18 '22 14:09

Sophie Alpert


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
like image 20
Adam Rosenfield Avatar answered Sep 19 '22 14:09

Adam Rosenfield