I'm trying to display a photo that is 299 x 153 pixels (300 dpi) in a document but it gets "shrinked" for some reason.

The actual photo:

enter image description here

Minimal Working Example (MWE):






The output:

enter image description here

Desired outcome:

To get the actual size of the photo to output in the .tex document as indicated by the first photo.

  • Does \includegraphics[width=299px,height=153px]{phpmyadmin-dropdatabase-op.png} solve this? – cauchy42 Sep 1 '15 at 6:58
  • @cauchy42 It seems to fix it in the MWE but not in my template. It gets "wrangled". See updated MWE. – kexxcream Sep 1 '15 at 7:03
  • 2
    You redefine \includegraphics with the first argument being optional, but call it only with its second argument. As you don't specify the first (which would be the width, I suppose), you have no control. Calling \includegraphics[width=233px]{phpmyadmin-dropdatabase-op.png} does what you want. But then, you need not redefine the macro, as the original \includegraphics has much more capabilities. – cauchy42 Sep 1 '15 at 7:27
  • 1
    \newlength{\pixel} \setlength{\pixel}{\dimexpr 1in/300} will give you 300dpi. [width=299\pixel,height=153\pixel] – John Kormylo Sep 1 '15 at 16:13



to get the actual size, if you want to fill in the width of the page, use:


if you want to limit the height in some way, use something like:



| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.