9

I created a PNG file (763px by 600px at 72DPI) from a free image. I opened the image in GIMP and changed the DPI to 300 and saved it. After including it in a LaTeX file with

\includegraphics[scale=1.0]{file.png}

and running pdflatex, the image looked good on the page. I wanted it a little bit larger, so I changed the DPI in GIMP to 600 and saved the file. After recompiling the source, the image is now much smaller on the output PDF. What have I done wrong?

2
  • 7
    dpi stands for dots per inch, so it's the pixel density (or "resolution"). Changing the dpi does not change the number of pixels, it's always 763x600. At 300 dpi, your image takes up 2.54in x 2in (763 dots / 300 dots per inch), at 600dpi it only takes up 1.27in x 1in (763 dots / 600 dots per inch). What you should do, instead of setting the resolution in GIMP, is to say \includegraphics[width=4in]{file.png}. This specifies the desired width, independent of the image resolution.
    – Jake
    Commented Dec 17, 2012 at 14:48
  • Thanks for the explanation. Changing the image to 150 DPI increased the size of the image in the PDF. Edit: I'll try the additional suggestion you just made in your updated comment too.
    – SabreWolfy
    Commented Dec 17, 2012 at 14:51

1 Answer 1

12

The DPI measure the displayed number of Dot Per Inch. If you increase the DPI, it is normal that your picture dimensions will decrease at the same scale.

You do not need to change the DPI, you should insert your image like this:

\includegraphics[width=Xcm]{file.png}

to have a picture of a width equal to Xcm (height automatically adjusted, or height=Xcm). Or:

\includegraphics[width=Xcm,height=Ycm,keepaspectratio]{file.png}

to have an image of X by Y cm, with respect to proportion.

The DPI matter is important in that way: if you have a picture of 1in x 1in at 100 DPI (ie 100px x 100 px), the scaling to 6in x 6in will not look good...

2
  • 2
    How can I know what's my PDF DPI?
    – Royi
    Commented Jun 9, 2017 at 11:15
  • @Royi PDFs do not have DPI, cause they can incorporate also vector graphics. If a PDF contains only raster image(s), you can extract such image (there are many tools, I use pdfimages from Poppler package) and work with it.
    – mmj
    Commented Jun 7, 2021 at 10:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .