I want to put integer labels on the grid. The grid size depends on the image loaded.
The real scenario is to vectorize a JPG image but I need a grid label for navigation as follows
\documentclass{article}
\usepackage{tikz}
\usepackage{graphicx}
\newsavebox\TempBox
\savebox\TempBox{\includegraphics{batman.jpg}}
\begin{document}
\begin{tikzpicture}
\node[inner sep=0] at (0,0) {\usebox\TempBox};
\draw[white](-0.5\wd\TempBox,-0.5\ht\TempBox) grid (0.5\wd\TempBox,0.5\ht\TempBox);
% I want to put integer labels for navigation purpose. The following code cannot be compiled!
%\foreach \x in {-0.5\wd\TempBox,1,...,0.5\wd\TempBox} { \node [anchor=north] at (\x,0) {\x}; }
%\foreach \y in {-0.5\ht\TempBox,1,...,0.5\ht\TempBox} { \node [anchor=east] at (0,\y) {\y}; }
\draw[line width=2pt,blue] (0,0) ellipse (6.3 and 3.4);
\draw[line width=2pt,blue] (0,0) ellipse (6.9 and 4.0);
\end{tikzpicture}
\end{document}
The following figure is the original image to complete the MWE.
How to create integer labels on TikZ grid?
I might need something like floor
or ceiling
functions here.