Comments on: Convert PNG to EPS http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: fdgs http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-20489 Mon, 10 Oct 2011 09:43:02 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-20489

The only slight disadvantage of doing this is that you pay a considerable size penalty for this conversion

This made me giggle.

Reply  |  Quote
]]>
By: Abhi http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-19809 Fri, 29 Jul 2011 10:15:13 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-19809

HI Luke,
Nice post buddy.
However I am experiencing something weird.
I generate a .png file from matlab, somehow I am having problems with .eps/.pdf files in Matlab. My .png file looks pretty, and now when I am converting this to .eps using $ sam2p test15_111.png EPS: test-1.eps
I am experiencing something weird, that .eps files looks a bit stretched and also I loose the axis labels I have on my .png file. Can you please help me on this?
Thanks

Reply  |  Quote
]]>
By: Nana http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-19295 Fri, 03 Jun 2011 02:12:00 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-19295

Really helpful!

Reply  |  Quote
]]>
By: Risto http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-18297 Tue, 18 Jan 2011 15:00:26 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-18297

Neat! Thanks guys! A simple convert worked for me!

convert banana.png banana.eps

Reply  |  Quote
]]>
By: psfrag http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-17308 Wed, 29 Sep 2010 08:43:30 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-17308

@ Chris:

This is partially true. For example, if you use the package “psfrag” to replace text characters in your graphics by equations (or just because you want to use in your plot the same font that you use in the rest of the document). For doing this, the figure must be given in EPS format.

Reply  |  Quote
]]>
By: foobar http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-14476 Thu, 04 Mar 2010 14:19:44 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-14476

Luke Maciak wrote:

@ Niek:

Oh, then you can do the following:

for i in $( ls *.png ); do
sam2p $i EPS: $i.eps
done
This will iterate over all the png files in the directory.

If someone is reading these, I should probably mention that using ls here breaks if the png files have whitespace in their names. Just use

for i in *.png; do

done

instead.

Reply  |  Quote
]]>
By: Niek http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13912 Sun, 03 Jan 2010 13:12:57 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13912

@ Luke Maciak:
Let me start with wishing you a Happy 2010!
Then on the topic: I did find the pngtopnm package, although it wasn’t in the repositories. I have downloaded png22pnm from the code site of sam2p (http://code.google.com/p/sam2p/). The errors above vanished and it seemed to start working, but the next error I got is that there were too many colors in my png-file. Quite strange because these were pictures drawn by a java-application (geogebra) and I have read that people have used sam2p to convert even pictures. How many more colors can a drawing have compared to a picture?
Anyway, II gave up and converted all of the files by hand using GIMP.

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13885 Thu, 31 Dec 2009 08:44:56 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13885

@ Niek:

Sounds like you might be missing pngtopnm whatever that is. I’m not on linux right now, but I’d see if you can apt-get that pngtopnm package. Or obtain it using the package management system that is used by your distro.

Reply  |  Quote
]]>
By: Niek http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13884 Thu, 31 Dec 2009 07:51:29 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13884

@ Luke Maciak:
Thank you Luke, this would work perfectly. In fact it tries to run all the png-images in a folder. Seems to be a problem with sam2p though that keeps it from converting. Probably a crapy install. It echos

sh: pngtopnm: not found
sam2p: Error: Filter::PipeE: system() failed: (if (type -p png22pnm >/dev/null); then png22pnm -rgba /tmp/tmp__sam2p__6498_0; else (pngtopnm </tmp/tmp__sam2p__6498_0 && pngtopnm -alpha /tmp/tmp__sam2p__6498_1

It does that even when you try to convert just one file with a straight forward command line. I will try to find out how to handle this.

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13878 Wed, 30 Dec 2009 19:11:52 +0000 http://www.terminally-incoherent.com/blog/2007/01/18/convert-png-to-eps/#comment-13878

@ Niek:

Oh, then you can do the following:

for i in $( ls *.png ); do
      sam2p $i EPS: $i.eps
done

This will iterate over all the png files in the directory.

Reply  |  Quote
]]>