0

Below code can get picture width and height in pt, what's the right way to get width and height in pixel?

\documentclass[border=1pt,convert={outfile=\jobname.png}]{standalone}
\usepackage{tikz}
\usepackage{calc}
%https://upload.wikimedia.org/wikipedia/commons/6/62/Panthera_tigris_sumatran_subspecies.jpg
\newsavebox{\graph}\savebox{\graph}{\includegraphics{Panthera_tigris_sumatran_subspecies.jpg}}
\newlength\gh\setlength\gh{\heightof{\usebox\graph}}
\newlength\gw\setlength\gw{\widthof{\usebox\graph}}
\begin{document}
\begin{tikzpicture} 
    \node[draw] {\the\gw,\the\gh};
\end{tikzpicture}
\end{document}

Output:

enter image description here

lucky1928
  • 4,151

0 Answers0