I ran into the following curiosity while using the graphicx package. When including two images of the same size, I scaled them using the same ratio (see example below). However the images didn't come out the same size. Does this have something to do with pixel density?

Here is a MWE:



Here are the two images:enter image description here enter image description here

and finally here is the screen shot of the MWE:

enter image description here

1 Answer 1


The one image is saved as 96 ppi, the other as 72 ppi. They have the same pixel dimensions (which is what your browser uses as seen above) but they aren't the same size, as in nominal area on paper, i.e. dimensions in mm/inch/whatever (which is what TeX uses). You can fix this with gimp or something like that. Or you use width or height instead of scale. scale has nothing to do with it by the way. If you omit it in your MWE, the size difference persists.

  • 2
    For anyone interested, gimp can change ppi by going to Image -> Scale Image -> X/Y resolution.
    – RghtHndSd
    Sep 19, 2013 at 21:35
  • 1
    @RghtHndSd Right, I should have mentioned that. Also, for PNG this method is just fine because they are lossless and you can save them as often as you want without degradation. JPEG stores the ppi information in the EXIF data AFAIK and to change those, an EXIF editor would be a much wiser choice than gimp or any other image processor. Maybe ImageMagick is smart enough to not recompress the JPEG but that I do not know.
    – Christian
    Sep 19, 2013 at 22:50

You must log in to answer this question.

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