Graphics, Figures & TablesEfficient jpg/png to eps conversion ?

Information and discussion about graphics, figures & tables in LaTeX documents.
M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Efficient jpg/png to eps conversion ?

Post by M.A »

Hi everyone,
My question is:
What is the most efficient way to convert jpg/png files to eps? efficient in the sense of the smallest eps output file size.

I have tried two ways but I got the eps size very large with respect to the jpg file.
For example, the attached jpg image has a size of 62.4 KB.

The first method is to use a postscript printer, and the output size was 1.66 MB !!

The second method is to use Adobe Acrobat to convert jpg to pdf then to eps, the output file size was 258 KB which is better but still large.

so do you have more efficient ways for conversion?
Attachments
amazing.jpg
amazing.jpg (62.48 KiB) Viewed 38390 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Efficient jpg/png to eps conversion ?

Post by localghost »

Conversion is not recommendable. It is better to compile directly with pdflatex. Since it accepts JPG and PNG files, this makes conversion superfluous.


Best regards
Thorsten
M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Re: Efficient jpg/png to eps conversion ?

Post by M.A »

I use latex.exe because of PSTricks codes which doesn't work with pdflatex
and I need to include some JPG/PNG images in the same document

Best Regards,
M.A
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Efficient jpg/png to eps conversion ?

Post by localghost »

M.A wrote:I use latex.exe because of PSTricks codes which doesn't work with pdflatex and I need to include some JPG/PNG images in the same document […]
Use the auto-pst-pdf package to make PSTricks possible with pdflatex. Take a close look at the package manual. There you will find all important instructions to get things work. Note that this will extend the compilation time because there are several auxiliary calls necessary.
M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Re: Efficient jpg/png to eps conversion ?

Post by M.A »

Thanks for your suggestion,
but I still prefer to use latex.exe. Furthermore, PStricks isn't the only package that doesn't work with pdflatex, there is for example powerdot and others.

so I would like to know the best way for converting jpg to eps.

Regards,
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Efficient jpg/png to eps conversion ?

Post by localghost »

M.A wrote:[…] but I still prefer to use latex.exe and I would like a better for converting jpg to eps. […]
Of course the final choice is up to you. I can only give advice and introduce methods to avoid a detour (but I don't have to). If someone is resistant to advice, I can't change that. But perhaps you can explain to me why latex is so preferable from your point of view.

You only should know that converting photos from JPG or PNG will result in a loss of quality and a document blown up in its size. EPS is a vector based format and made for other types of pictures. Even if you convert your image files, you will never benefit from the vector character of that format. You will always have a pixel based image file.

Supplement:
M.A. wrote:[…] Furthermore, PStricks isn't the only package that doesn't work with pdflatex, there is for example powerdot and others. […]
You should have given this important information right at the beginning.
M.A
Posts: 58
Joined: Sun Nov 30, 2008 10:42 am

Re: Efficient jpg/png to eps conversion ?

Post by M.A »

I understand what you are saying but it remains a trade-off between latex and pdflatex.

However, still I didn't get an answer for my original question :roll:.


N.B. I modified my last post before you reply, sorry for the inconvenience.

Regards,
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Efficient jpg/png to eps conversion ?

Post by T3. »

You need to convert to level II or III eps, because level I doesn't support compressed jpeg format, see here for various approaches. I use convert utility from ImageMagick:

Code: Select all

convert file.jpg eps3:file.eps
Cheers,

Tomek
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: Efficient jpg/png to eps conversion ?

Post by spiegboy »

you can take following steps:

(i)print the picture by adobe pdf printer
(ii) select the picture in the pdf file and then print by adobe ps printer
(iii) practise the function of ps-eps by the gsviewer

you probably end up a eps file ca. 100k.

I am using latex-ps-pdf all the time, i understand your aspiration to a easy way to making eps file. there are two options:
1) consider the admin's advice to use pdflatex
2) try to use some softwares with the functionality to transferring the picture formats, presumably the proposed imagemag will do the trick.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Efficient jpg/png to eps conversion ?

Post by localghost »

spiegboy wrote:[...] 1) consider the admin's advice to use pdflatex [...]
This option is not considerable. The used powerdot class relies on pstricks.
Post Reply