LaTeX forum ⇒ 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 ?

Postby M.A » Sun Jun 28, 2009 3:59 pm

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 28263 times

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

Postby localghost » Sun Jun 28, 2009 4:32 pm

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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby M.A » Sun Jun 28, 2009 4:43 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sun Jun 28, 2009 5:07 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby M.A » Sun Jun 28, 2009 5:24 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sun Jun 28, 2009 5:35 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby M.A » Sun Jun 28, 2009 5:58 pm

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

Postby T3. » Sun Jun 28, 2009 6:47 pm

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:
  1. convert file.jpg eps3:file.eps

Cheers,

Tomek

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

Postby spiegboy » Mon Jun 29, 2009 7:32 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Jun 29, 2009 8:29 pm

spiegboy wrote:[...] 1) consider the admin's advice to use pdflatex [...]

This option is not considerable. The used powerdot class relies on pstricks.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests