Monday, December 3, 2007

Graphics conversion hacks

I had to convert a slew of images into png and eps so they would work in a LaTeX document. The following proved useful to me:

  • img2eps to covert gif, jpeg, png, tiff, and xpm to eps.

  • giftopng to convert gifs to png. find . -iname "*.gif" -exec giftopng {} \;

  • And a short script to convert jpg to png:

    • #!/bin/bash

    • filename=${1%.jpg}

    • jpegtopnm "$1" | pnmtopng > "$filename.png"




I'm sure there are better ways but these worked for me.

No comments: