[Tex/LaTex] How to label an image inside tikz

tikz-pgf

I want to label the images img1 and img2.. can i do that inside my \node?
If yes, how??

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
        \path (0,0) node(a) {\includegraphics[width=2cm] images/img1.png}};
        \path (1,6) node(b) {\includegraphics[width=2cm]{images/img2.png}};
        \path (9,6) node(c) {\includegraphics[width=2cm]{images/img3.png}};
        \path (10,0) node(d) {\includegraphics[width=2cm]{images/img4.png}};
        \draw[very thick,green] (a) -- (b) node [midway,right]{\parbox{4cm}{TLS Password Based\\ Authentication}};
        \draw[very thick,red] (b) -- (c) node [midway,above]{Certificate based Authentication};
        \draw[very thick,green] (c) --(d);
\end{tikzpicture}    
\end{document}

What i mean by label is that something like this..

\path (\x,\y) node(a) [rectangle, draw,thick] {This is a rectangle};

Something like this as shown in figureas "Alice", "Bob", SIP Proxy Server Domain" etc..
enter image description here

Best Answer

How about this:

\documentclass{article}
\usepackage{tikz}
\usepackage{lipsum}

\parindent0mm

\begin{document}

\begin{tikzpicture}
    \draw (-3,-1) rectangle (3,1) (-2,-2) rectangle (2,2);
    \node[below right] at (current bounding box.south west) {\textbf{Image 1: rectangles}};
\end{tikzpicture}

\lipsum[1]

\begin{tikzpicture}
    \draw (-3,-1) circle (1) (-2,-2) circle (2);
    \node[below right] at (current bounding box.south west) {\textbf{Image 2: circles}};
\end{tikzpicture}

\end{document}

enter image description here


Edit 1: Probably like this (the icon are taken from here):

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
    \node (cal) at (0,0) {\includegraphics[scale=4]{Calendar2.png}};
    \node (dow) at (7,0) {\includegraphics[scale=1.7]{Downloads.png}};  
    \node (fol) at (7,7) {\includegraphics[scale=1.7]{Folder.png}};
    \node (emo) at (0,7) {\includegraphics[scale=1.7]{Emoticons.png}};

    \node[below right] at (emo.south west) {\textbf{Img 1:} Emoticon};
    \node[below right] at (fol.south west) {\textbf{Img 2:} Folder};
    \node[below right] at (cal.south west) {\textbf{Img 3:} Calendar};
    \node[below right] at (dow.south west) {\textbf{Img 4:} Downloads};
\end{tikzpicture}

\end{document}

enter image description here

Related Question