Graphics, Figures & Tablesconversion jpg -> eps

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jerome
Posts: 6
Joined: Mon Jul 19, 2010 5:32 pm

conversion jpg -> eps

Post by jerome »

Hello!

I want to convert jpg files to eps, so I've made some research on this forum to find the best software and the method.

So far, I've tried ImageMagick and Inkscape to convert the picture hereafter:
IMG_0021c.jpg
IMG_0021c.jpg (40.56 KiB) Viewed 12941 times
As a result, i get only the background of my picture, i.e the blue pattern.

What am i doing wrong?

Thanks for your help,
Jerome. :)

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: conversion jpg -> eps

Post by Stefan Kottwitz »

Hi Jerome,

just for info: if you would like to use the picture with LaTeX and if this is the reason why you wish to convert it to eps: pdfLaTeX supports the jpg format directly.

Stefan
LaTeX.org admin
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: conversion jpg -> eps

Post by frabjous »

I just tried both methods on your file, and the results of both converting through ImageMagick, and converting through Inkscape looked perfectly fine to me.

The only issue I saw is that they resulted in incredibly huge files. The one from ImageMagick was over 4MB and the one from Inkscape was over 1MB, both too large to post here (even if compressed).

But if you want me to send you the files, just let me know through IM.
jerome
Posts: 6
Joined: Mon Jul 19, 2010 5:32 pm

conversion jpg -> eps

Post by jerome »

Hi,

Stefan_K: thanks for your reply. Indeed, I use pdfLateX sometimes to include jpg in my documents. The reason I am posting this question is only to learn how to convert jpg to eps properly.

frabjous: well, i'm very confused... Let me tell you how i tried to convert the files, maybe you can tell me where i am doing wrong:
- with ImageMagick, i open a command window, and write: convert my_file.jpg eps3:my_file.eps
- with Inkscape, i open my jpg and then save as... my_file.eps. And this is what i get:
Image1.jpg
Image1.jpg (24.81 KiB) Viewed 12935 times
Although, I've just realized something: after converting with Inkscape, if I re-open the eps file with Inskape, i see my full picture. The picture above is only the one gotten when i open the file with GSview.

Does that make sense??

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

conversion jpg -> eps

Post by localghost »

I did the conversion on the terminal of my Linux system² with ImageMagick 6.5.4 and can't comprehend any of the described problems.

Code: Select all

convert IMG_0021c.jpg eps3:IMG_0021c.eps
I checked the EPS file in the Okular viewer and the whole picture was displayed. The resulting file has nearly the same size. Perhaps later I will have the opportunity to test it on Windows. The concerned file is attached for comparison.


Thorsten
Attachments
IMG_0021c.eps
The provided JPG image converted to EPS with ImageMagick (6.5.4).
(40.4 KiB) Downloaded 461 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: conversion jpg -> eps

Post by frabjous »

For ImageMagick (I'm using 6.6.2), I just did:

convert IMG_0021c.jpg IMG_0021c.eps

for Inkscape I did the same you did.

I can't explain the difference either.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

conversion jpg -> eps

Post by localghost »

frabjous wrote:For ImageMagick (I'm using 6.6.2), I just did:

convert IMG_0021c.jpg IMG_0021c.eps [...]
Did exactly this on my notebook with ImageMagick 6.6.1 and got the same result with a 4.1MB sized file. You simply forgot to convert to PostScript level 3. So you need the appropriate prefix.

Code: Select all

convert IMG_0021c.jpg eps3:IMG_0021c.eps
With ImageMagick 6.6.1 I then got the same result as described in my last reply (file size 40.4KB).
jerome
Posts: 6
Joined: Mon Jul 19, 2010 5:32 pm

Re: conversion jpg -> eps

Post by jerome »

Thanks localghost for your help; i used the prefix eps3 to convert the file. When you open it with GSview, do you see the full picture?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

conversion jpg -> eps

Post by localghost »

jerome wrote:[…] When you open it with GSview, do you see the full picture?
In the meantime I had the opportunity to check that on Windows². GSview (with GPL Ghostscript 8.71) displays a little bit more than the left half of the picture. But this is due to its size (1024×683 postscript points) and the chosen page format. The right side of its bounding box is beyond the scope of the page. The inclusion into a LaTeX document however works just fine (see attachment). So this shouldn't bother you.

Code: Select all

\documentclass{article}
\usepackage{graphicx}

\begin{document}
  \includegraphics[scale=0.25]{IMG-0021c}
\end{document}
Note that special characters (blank spaces, underscores, …) should be avoided in the complete path and the name of the file. This is why I renamed the EPS file.
Attachments
EPSinc.ps
The converted image included into a LaTeX document.
(62.61 KiB) Downloaded 432 times
Post Reply