GeneralJPEG images in LaTeX

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
arn1980
Posts: 1
Joined: Wed Jun 04, 2008 3:35 pm

JPEG images in LaTeX

Post by arn1980 »

Hi,

I am writing a document in LaTeX and want to import some illustrations. The illustrations are jpeg images and the current quality of the images (when looking at the final generated PDF file) is not that well. I was wondering if it makes a difference when I convert the images from JPEG (The original image is JPEG) to eps.

Any other ways to improve image quality are more then welcome as well

Greetings,
Arno Krol

Recommended reading 2024:

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

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

tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

JPEG images in LaTeX

Post by tripwire45 »

Do you have the following in the preamble of your document?

Code: Select all

\usepackage[pdftex]{color,graphicx}
The documents I maintain for PDF contain loads of .png files and they all render fine. I tried using eps graphics, but they looked terrible.

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

JPEG images in LaTeX

Post by localghost »

tripwire45 wrote:Do you have the following in the preamble of your document?

Code: Select all

\usepackage[pdftex]{color,graphicx}
[...]
This is not a good idea, since the graphicx package detects on its own which compiler is running hence it doesn't need any driver option and will search the right file by itself. Using the xcolor package allows a more comfortable handling of colours.

Code: Select all

\usepackage{graphicx}
\usepackage{xcolor}
For more information refer to the documentations of these packages.
arn1980 wrote:[...] The illustrations are jpeg images and the current quality of the images (when looking at the final generated PDF file) is not that well. [...]
You have to be more precise. Perhaps a screen shot could help. For the present, you should scale your graphics files to three quarters of their original size.

Code: Select all

\includegraphics[scale=0.75]{foo}
This comes from the relation between postscript points and pixels. You can calculate that easily by yourself with an on-line conversion tool [1].
arn1980 wrote:[...] I was wondering if it makes a difference when I convert the images from JPEG (The original image is JPEG) to eps. [...]
Of course it makes a difference. JPG is a pixel based format (bitmap), whereas EPS is vector based. JPG is supposed to be a format for photos. With EPS you can produce high quality diagrams with no loss of quality when scaled. So, if your graphics are originated in a pixel based format, keep it.

[1] PostScript Point to Pixels (X) Conversion Calculator


Best regards and welcome aboard
Thorsten
User avatar
tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

Re: JPEG images in LaTeX

Post by tripwire45 »

I stand corrected, Thorsten. Thanks.
Post Reply