# Tikz Spy, different image magnified?

I'm using tikz library spy to zoom into an image. The image Im zooming into is a binary black and white image. But i want the circle with the magnified part to be filled with a color version of the same image. Is this possible?

\documentclass[12 pt,onecolumn]{article}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{xcolor}
\usetikzlibrary{spy}
\pgfplotsset{compat=1.5}
\begin{document}

\begin{figure}
\begin{tikzpicture}[spy using outlines={circle,yellow,magnification=5,size=5cm, connect spies}]
\node[anchor=south west,inner sep=0]  at (0,0) {\includegraphics[width=\textwidth]{images/film-stupid-duck}};
\spy on (12.2,5.2) in node [left] at (16,10);
\spy on (6,4) in node [left] at (10,10);
\path[fill=white] (5,0) rectangle (12,2);
\end{tikzpicture}
\caption{}
\label{}
\end{figure}
\end{document}


The picture below is my current result. I want the two magnified images to be from a second image that matches spatially

• No it simply copies what is there in the original. It's pretty nontrivial to get a different version of the image unless you pull off some layering tricks May 18, 2014 at 15:38
• A full compilable example would be welcome. May 18, 2014 at 15:38

Don't know if this is quite right but it seems to work (although not in any way fully tested).

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{spy}
\begin{document}

\makeatletter
\tikzset{spy on other/.code={%
\setbox\tikz@lib@spybox=\hbox{\pgfpicture#1\endpgfpicture}}}}
\makeatother

\begin{tikzpicture}[spy using outlines={circle,yellow,magnification=5,size=5cm, connect spies}]
\fill [black, even odd rule]
(6,0) rectangle (9,15)  (0,6) rectangle (15,9);

\tikzset{spy on other={
\fill [left color=red, right color=blue, even odd rule]