\begin{tikzpicture}[auto, on grid, scale=.5, y=-1cm, every node/.style={scale=.5, y=-1cm}] \def\BlockSize{4} \tikzstyle{TextStyle}=[text centered, scale=1/.5, font=\footnotesize] \tikzstyle{PU} =[draw, minimum height=\BlockSize cm, minimum width=\BlockSize cm] \tikzstyle{Neighbour} =[draw, minimum height=1 cm, minimum width=\BlockSize cm, fill=gray!60] \tikzstyle{PixelAnchor} =[xshift=.5cm, yshift=-.5cm] \tikzstyle{Pixel} =[circle, thin, fill=lightgray, inner sep=0, minimum size=10pt] \tikzstyle{PixelNeighbour} =[Pixel, fill=black!70] \tikzstyle{Arrow} =[-latex,thick, draw=black] \tikzstyle{NeighbourSquares} =[fill=TikZColorFillDark] \draw[Pixel] (0,0) grid ++(4.5,4.5); \node[NeighbourSquares, anchor=north west, minimum width=1cm, minimum height=1cm] at (-1,-1) {}; \node[NeighbourSquares, anchor=north west, minimum width=4cm, minimum height=1cm] at (0,-1) {}; \node[NeighbourSquares, anchor=north west, minimum width=4cm, minimum height=1cm] at (4,-1) {}; \node[NeighbourSquares, anchor=north west, minimum width=1cm, minimum height=4cm] at (-1,0) {}; \node[NeighbourSquares, anchor=north west, minimum width=1cm, minimum height=4cm] at (-1,4) {}; % Pixels \foreach \x in {0,...,3} \foreach \y in {0,...,3} { \node at (\x,\y) [PixelAnchor,Pixel]() {}; } \foreach \x in {-1} \foreach \y in {-1,...,7} { \node at (\x,\y) [PixelAnchor,PixelNeighbour]() {}; } \foreach \x in {0,1,...,7} \foreach \y in {-1} { \node at (\x,\y) [PixelAnchor,PixelNeighbour]() {}; } \path[PixelAnchor, Arrow, dashed] (.5,-1) -- ( 0 , 0 ); \path[PixelAnchor, Arrow, ] (1,-1) -- ( 0 , 1 ); \path[PixelAnchor, Arrow, dashed] (1.5,-1) -- ( 0 , 2 ); \foreach \x in {2,...,5} { \path[PixelAnchor,Arrow] (\x,-1) -- ++(-2, \BlockSize); } \foreach \x in {2.5,...,4.5} { \path[PixelAnchor,Arrow,dashed] (\x,-1) -- ++(-1.5, \BlockSize - 1); } \path[Arrow, very thick, -] (-1,4) -- ++(6,0); \path[Arrow, very thick, -] (4,-1) -- ++(0,6); \path[Arrow, very thick, -] (-1,0) -- ++(1,0); \path[Arrow, very thick, -] (0,-1) -- ++(0,1); \path[Arrow, very thick, -] (0,0) -- ++(4,0) node[TextStyle, midway,above, yshift=.4cm] {Top}; \path[Arrow, very thick, -] (4,0) -- ++(4,0) node[TextStyle, midway,above, yshift=.4cm] {Top-right}; \node[TextStyle] at (-1.2,-1.5) {Top-left}; \path[Arrow, very thick, -] (0,0) -- ++(0,4) node[TextStyle, midway,above, xshift=-.5cm, rotate=90] {Left}; \path[Arrow, very thick, -] (0,4) -- ++(0,4) node[TextStyle, midway,above, xshift=-.5cm, rotate=90] {Bottom-left}; \node[TextStyle, anchor=south west, align=left, text width=4cm] at (4,7) (RefLabel) {Reference pixels}; \node[TextStyle, anchor=south west, align=left, text width=4cm, below=.5cm of RefLabel] (PredLabel) {Predicted pixels}; \node[TextStyle, anchor=south west, align=left, text width=4cm, below=.5cm of PredLabel] (PredDir) {Prediction direction}; \node[Pixel, , minimum size=12pt, left=.1 cm of PredLabel.west] {}; \node[PixelNeighbour, minimum size=12pt, left=.1 cm of RefLabel.west] {}; \path[Arrow, latex-] (PredDir.west) -- ++(-1,0); % \path[PixelAnchor, Arrow, blue] (2.75,-1) -- ++( -2 , \BlockSize ); \end{tikzpicture}