Two images one on the other

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite












I have two picture, one (Image 1) is the big one while the other (Image 2) is the small one that is a detail of the big one. I would like to do something like the zoom option (with tikzpicture) but instead to have the zoomed image image I just want to see the other image. Everything inside a figure with its caption.



I made an example in case is difficult to understand what I want to do.
enter image description hereImage 1 is my main image, the cross represents the schematised detail that is explained with Image 2. The two images are two .png.



Is it possible?







share|improve this question
















  • 1




    Possible duplicate: Drawing on an image with TikZ
    – Werner
    Aug 21 at 16:09














up vote
6
down vote

favorite












I have two picture, one (Image 1) is the big one while the other (Image 2) is the small one that is a detail of the big one. I would like to do something like the zoom option (with tikzpicture) but instead to have the zoomed image image I just want to see the other image. Everything inside a figure with its caption.



I made an example in case is difficult to understand what I want to do.
enter image description hereImage 1 is my main image, the cross represents the schematised detail that is explained with Image 2. The two images are two .png.



Is it possible?







share|improve this question
















  • 1




    Possible duplicate: Drawing on an image with TikZ
    – Werner
    Aug 21 at 16:09












up vote
6
down vote

favorite









up vote
6
down vote

favorite











I have two picture, one (Image 1) is the big one while the other (Image 2) is the small one that is a detail of the big one. I would like to do something like the zoom option (with tikzpicture) but instead to have the zoomed image image I just want to see the other image. Everything inside a figure with its caption.



I made an example in case is difficult to understand what I want to do.
enter image description hereImage 1 is my main image, the cross represents the schematised detail that is explained with Image 2. The two images are two .png.



Is it possible?







share|improve this question












I have two picture, one (Image 1) is the big one while the other (Image 2) is the small one that is a detail of the big one. I would like to do something like the zoom option (with tikzpicture) but instead to have the zoomed image image I just want to see the other image. Everything inside a figure with its caption.



I made an example in case is difficult to understand what I want to do.
enter image description hereImage 1 is my main image, the cross represents the schematised detail that is explained with Image 2. The two images are two .png.



Is it possible?









share|improve this question











share|improve this question




share|improve this question










asked Aug 21 at 15:56









Shika93

1266




1266







  • 1




    Possible duplicate: Drawing on an image with TikZ
    – Werner
    Aug 21 at 16:09












  • 1




    Possible duplicate: Drawing on an image with TikZ
    – Werner
    Aug 21 at 16:09







1




1




Possible duplicate: Drawing on an image with TikZ
– Werner
Aug 21 at 16:09




Possible duplicate: Drawing on an image with TikZ
– Werner
Aug 21 at 16:09










3 Answers
3






active

oldest

votes

















up vote
8
down vote



accepted










Starting point. Now, you only need to connect the other anchors and decide the right position for the squares.



enter image description here



documentclassreport
usepackagetikz
usepackagegraphicx
usepackagelipsum
begindocument
lipsum[1]
beginfigure[h]centering
begintikzpicture
node[draw] (one) at (0,0)includegraphics[width=6cm]example-image-a;
node[anchor=north,draw,inner sep=0pt] (two) at ([xshift=-1cm]one.north west)includegraphics[width=1cm]example-image-b;
node[draw] (rect) at (-1,0);
draw (two.south east) -- (rect.south west);
endtikzpicture
captiontext
endfigure

lipsum[2]
enddocument





share|improve this answer






















  • Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
    – Shika93
    Aug 21 at 19:59







  • 1




    Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
    – Sigur
    Aug 21 at 21:54










  • Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
    – Shika93
    Aug 21 at 22:37










  • @Shika93, you're welcome.
    – Sigur
    Aug 21 at 22:43

















up vote
6
down vote













A solution using path picture to clip the zoom.



And as @Sigur said 'Starting point. Now, you only need to connect the other anchors and decide the right position for the' circles.



documentclass[a4paper, 12pt]article
usepackagemwe
usepackagetikz

begindocument

beginfigure[h!]
centering
includegraphics[width=.7linewidth]example-image
caption[Text for the list of figures]Text under the figure
labelfig:theReference0
endfigure

beginfigure[h!]
centering
begintikzpicture
[path image/.style=path picture=node at (path picture bounding box.center) includegraphics[height=3cm]#1;]

node (img) includegraphics[width=.7linewidth]example-image;
node (c1) [draw, circle, red, text width=.7cm] at (img.center) ;
draw [red] (c1.east) -- (img.east);
draw [path image=example-image-a,draw=red,thick] (img.east) circle (2cm);
endtikzpicture
caption[Text for the list of figures]Text under the figure
labelfig:theReference
endfigure
enddocument


enter image description here






share|improve this answer




















  • + Capitalizing the "a" to emphasize magnification
    – Carel
    Aug 21 at 20:49

















up vote
1
down vote













With picture environment:



documentclassarticle

usepackagegraphicx

begindocument

noindent%
setlengthunitlengthtextwidth%
beginpicture(1,0.5)%
put(0.3,0)includegraphics[width=.7textwidth]example-image%
put(0,0.33)includegraphics[width=.2textwidth]example-grid-100x100bp%
put(0.0,0.33)line(4,-1).4
put(0.0,0.53)line(4,-1).4
put(0.2,0.33)line(4,-1).4
put(0.2,0.53)line(4,-1).4
put(0.4,0.23)line(1,0).2
put(0.4,0.43)line(1,0).2
put(0.4,0.23)line(0,1).2
put(0.6,0.23)line(0,1).2
endpicture%

enddocument





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f447012%2ftwo-images-one-on-the-other%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    8
    down vote



    accepted










    Starting point. Now, you only need to connect the other anchors and decide the right position for the squares.



    enter image description here



    documentclassreport
    usepackagetikz
    usepackagegraphicx
    usepackagelipsum
    begindocument
    lipsum[1]
    beginfigure[h]centering
    begintikzpicture
    node[draw] (one) at (0,0)includegraphics[width=6cm]example-image-a;
    node[anchor=north,draw,inner sep=0pt] (two) at ([xshift=-1cm]one.north west)includegraphics[width=1cm]example-image-b;
    node[draw] (rect) at (-1,0);
    draw (two.south east) -- (rect.south west);
    endtikzpicture
    captiontext
    endfigure

    lipsum[2]
    enddocument





    share|improve this answer






















    • Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
      – Shika93
      Aug 21 at 19:59







    • 1




      Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
      – Sigur
      Aug 21 at 21:54










    • Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
      – Shika93
      Aug 21 at 22:37










    • @Shika93, you're welcome.
      – Sigur
      Aug 21 at 22:43














    up vote
    8
    down vote



    accepted










    Starting point. Now, you only need to connect the other anchors and decide the right position for the squares.



    enter image description here



    documentclassreport
    usepackagetikz
    usepackagegraphicx
    usepackagelipsum
    begindocument
    lipsum[1]
    beginfigure[h]centering
    begintikzpicture
    node[draw] (one) at (0,0)includegraphics[width=6cm]example-image-a;
    node[anchor=north,draw,inner sep=0pt] (two) at ([xshift=-1cm]one.north west)includegraphics[width=1cm]example-image-b;
    node[draw] (rect) at (-1,0);
    draw (two.south east) -- (rect.south west);
    endtikzpicture
    captiontext
    endfigure

    lipsum[2]
    enddocument





    share|improve this answer






















    • Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
      – Shika93
      Aug 21 at 19:59







    • 1




      Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
      – Sigur
      Aug 21 at 21:54










    • Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
      – Shika93
      Aug 21 at 22:37










    • @Shika93, you're welcome.
      – Sigur
      Aug 21 at 22:43












    up vote
    8
    down vote



    accepted







    up vote
    8
    down vote



    accepted






    Starting point. Now, you only need to connect the other anchors and decide the right position for the squares.



    enter image description here



    documentclassreport
    usepackagetikz
    usepackagegraphicx
    usepackagelipsum
    begindocument
    lipsum[1]
    beginfigure[h]centering
    begintikzpicture
    node[draw] (one) at (0,0)includegraphics[width=6cm]example-image-a;
    node[anchor=north,draw,inner sep=0pt] (two) at ([xshift=-1cm]one.north west)includegraphics[width=1cm]example-image-b;
    node[draw] (rect) at (-1,0);
    draw (two.south east) -- (rect.south west);
    endtikzpicture
    captiontext
    endfigure

    lipsum[2]
    enddocument





    share|improve this answer














    Starting point. Now, you only need to connect the other anchors and decide the right position for the squares.



    enter image description here



    documentclassreport
    usepackagetikz
    usepackagegraphicx
    usepackagelipsum
    begindocument
    lipsum[1]
    beginfigure[h]centering
    begintikzpicture
    node[draw] (one) at (0,0)includegraphics[width=6cm]example-image-a;
    node[anchor=north,draw,inner sep=0pt] (two) at ([xshift=-1cm]one.north west)includegraphics[width=1cm]example-image-b;
    node[draw] (rect) at (-1,0);
    draw (two.south east) -- (rect.south west);
    endtikzpicture
    captiontext
    endfigure

    lipsum[2]
    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 21 at 16:14

























    answered Aug 21 at 16:08









    Sigur

    21.8k350130




    21.8k350130











    • Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
      – Shika93
      Aug 21 at 19:59







    • 1




      Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
      – Sigur
      Aug 21 at 21:54










    • Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
      – Shika93
      Aug 21 at 22:37










    • @Shika93, you're welcome.
      – Sigur
      Aug 21 at 22:43
















    • Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
      – Shika93
      Aug 21 at 19:59







    • 1




      Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
      – Sigur
      Aug 21 at 21:54










    • Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
      – Shika93
      Aug 21 at 22:37










    • @Shika93, you're welcome.
      – Sigur
      Aug 21 at 22:43















    Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
    – Shika93
    Aug 21 at 19:59





    Does it exist an easy way to find the right position for the small square? Like an online tool that gives the relative coordinate of the main image using just the mouse pointer?
    – Shika93
    Aug 21 at 19:59





    1




    1




    Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
    – Sigur
    Aug 21 at 21:54




    Mouse pointer is not good since usually the result is given in pixels. If you use Gimp (free) you can create a rectangle and see its coordinates in other units. Or use Imagemagick, which is lighter.
    – Sigur
    Aug 21 at 21:54












    Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
    – Shika93
    Aug 21 at 22:37




    Ok it doesn't matter, I made it in the old way. Thanks it's perfect!
    – Shika93
    Aug 21 at 22:37












    @Shika93, you're welcome.
    – Sigur
    Aug 21 at 22:43




    @Shika93, you're welcome.
    – Sigur
    Aug 21 at 22:43










    up vote
    6
    down vote













    A solution using path picture to clip the zoom.



    And as @Sigur said 'Starting point. Now, you only need to connect the other anchors and decide the right position for the' circles.



    documentclass[a4paper, 12pt]article
    usepackagemwe
    usepackagetikz

    begindocument

    beginfigure[h!]
    centering
    includegraphics[width=.7linewidth]example-image
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference0
    endfigure

    beginfigure[h!]
    centering
    begintikzpicture
    [path image/.style=path picture=node at (path picture bounding box.center) includegraphics[height=3cm]#1;]

    node (img) includegraphics[width=.7linewidth]example-image;
    node (c1) [draw, circle, red, text width=.7cm] at (img.center) ;
    draw [red] (c1.east) -- (img.east);
    draw [path image=example-image-a,draw=red,thick] (img.east) circle (2cm);
    endtikzpicture
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference
    endfigure
    enddocument


    enter image description here






    share|improve this answer




















    • + Capitalizing the "a" to emphasize magnification
      – Carel
      Aug 21 at 20:49














    up vote
    6
    down vote













    A solution using path picture to clip the zoom.



    And as @Sigur said 'Starting point. Now, you only need to connect the other anchors and decide the right position for the' circles.



    documentclass[a4paper, 12pt]article
    usepackagemwe
    usepackagetikz

    begindocument

    beginfigure[h!]
    centering
    includegraphics[width=.7linewidth]example-image
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference0
    endfigure

    beginfigure[h!]
    centering
    begintikzpicture
    [path image/.style=path picture=node at (path picture bounding box.center) includegraphics[height=3cm]#1;]

    node (img) includegraphics[width=.7linewidth]example-image;
    node (c1) [draw, circle, red, text width=.7cm] at (img.center) ;
    draw [red] (c1.east) -- (img.east);
    draw [path image=example-image-a,draw=red,thick] (img.east) circle (2cm);
    endtikzpicture
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference
    endfigure
    enddocument


    enter image description here






    share|improve this answer




















    • + Capitalizing the "a" to emphasize magnification
      – Carel
      Aug 21 at 20:49












    up vote
    6
    down vote










    up vote
    6
    down vote









    A solution using path picture to clip the zoom.



    And as @Sigur said 'Starting point. Now, you only need to connect the other anchors and decide the right position for the' circles.



    documentclass[a4paper, 12pt]article
    usepackagemwe
    usepackagetikz

    begindocument

    beginfigure[h!]
    centering
    includegraphics[width=.7linewidth]example-image
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference0
    endfigure

    beginfigure[h!]
    centering
    begintikzpicture
    [path image/.style=path picture=node at (path picture bounding box.center) includegraphics[height=3cm]#1;]

    node (img) includegraphics[width=.7linewidth]example-image;
    node (c1) [draw, circle, red, text width=.7cm] at (img.center) ;
    draw [red] (c1.east) -- (img.east);
    draw [path image=example-image-a,draw=red,thick] (img.east) circle (2cm);
    endtikzpicture
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference
    endfigure
    enddocument


    enter image description here






    share|improve this answer












    A solution using path picture to clip the zoom.



    And as @Sigur said 'Starting point. Now, you only need to connect the other anchors and decide the right position for the' circles.



    documentclass[a4paper, 12pt]article
    usepackagemwe
    usepackagetikz

    begindocument

    beginfigure[h!]
    centering
    includegraphics[width=.7linewidth]example-image
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference0
    endfigure

    beginfigure[h!]
    centering
    begintikzpicture
    [path image/.style=path picture=node at (path picture bounding box.center) includegraphics[height=3cm]#1;]

    node (img) includegraphics[width=.7linewidth]example-image;
    node (c1) [draw, circle, red, text width=.7cm] at (img.center) ;
    draw [red] (c1.east) -- (img.east);
    draw [path image=example-image-a,draw=red,thick] (img.east) circle (2cm);
    endtikzpicture
    caption[Text for the list of figures]Text under the figure
    labelfig:theReference
    endfigure
    enddocument


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 21 at 16:46









    NBur

    66311




    66311











    • + Capitalizing the "a" to emphasize magnification
      – Carel
      Aug 21 at 20:49
















    • + Capitalizing the "a" to emphasize magnification
      – Carel
      Aug 21 at 20:49















    + Capitalizing the "a" to emphasize magnification
    – Carel
    Aug 21 at 20:49




    + Capitalizing the "a" to emphasize magnification
    – Carel
    Aug 21 at 20:49










    up vote
    1
    down vote













    With picture environment:



    documentclassarticle

    usepackagegraphicx

    begindocument

    noindent%
    setlengthunitlengthtextwidth%
    beginpicture(1,0.5)%
    put(0.3,0)includegraphics[width=.7textwidth]example-image%
    put(0,0.33)includegraphics[width=.2textwidth]example-grid-100x100bp%
    put(0.0,0.33)line(4,-1).4
    put(0.0,0.53)line(4,-1).4
    put(0.2,0.33)line(4,-1).4
    put(0.2,0.53)line(4,-1).4
    put(0.4,0.23)line(1,0).2
    put(0.4,0.43)line(1,0).2
    put(0.4,0.23)line(0,1).2
    put(0.6,0.23)line(0,1).2
    endpicture%

    enddocument





    share|improve this answer
























      up vote
      1
      down vote













      With picture environment:



      documentclassarticle

      usepackagegraphicx

      begindocument

      noindent%
      setlengthunitlengthtextwidth%
      beginpicture(1,0.5)%
      put(0.3,0)includegraphics[width=.7textwidth]example-image%
      put(0,0.33)includegraphics[width=.2textwidth]example-grid-100x100bp%
      put(0.0,0.33)line(4,-1).4
      put(0.0,0.53)line(4,-1).4
      put(0.2,0.33)line(4,-1).4
      put(0.2,0.53)line(4,-1).4
      put(0.4,0.23)line(1,0).2
      put(0.4,0.43)line(1,0).2
      put(0.4,0.23)line(0,1).2
      put(0.6,0.23)line(0,1).2
      endpicture%

      enddocument





      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        With picture environment:



        documentclassarticle

        usepackagegraphicx

        begindocument

        noindent%
        setlengthunitlengthtextwidth%
        beginpicture(1,0.5)%
        put(0.3,0)includegraphics[width=.7textwidth]example-image%
        put(0,0.33)includegraphics[width=.2textwidth]example-grid-100x100bp%
        put(0.0,0.33)line(4,-1).4
        put(0.0,0.53)line(4,-1).4
        put(0.2,0.33)line(4,-1).4
        put(0.2,0.53)line(4,-1).4
        put(0.4,0.23)line(1,0).2
        put(0.4,0.43)line(1,0).2
        put(0.4,0.23)line(0,1).2
        put(0.6,0.23)line(0,1).2
        endpicture%

        enddocument





        share|improve this answer












        With picture environment:



        documentclassarticle

        usepackagegraphicx

        begindocument

        noindent%
        setlengthunitlengthtextwidth%
        beginpicture(1,0.5)%
        put(0.3,0)includegraphics[width=.7textwidth]example-image%
        put(0,0.33)includegraphics[width=.2textwidth]example-grid-100x100bp%
        put(0.0,0.33)line(4,-1).4
        put(0.0,0.53)line(4,-1).4
        put(0.2,0.33)line(4,-1).4
        put(0.2,0.53)line(4,-1).4
        put(0.4,0.23)line(1,0).2
        put(0.4,0.43)line(1,0).2
        put(0.4,0.23)line(0,1).2
        put(0.6,0.23)line(0,1).2
        endpicture%

        enddocument






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 21 at 19:28









        blub

        24712




        24712



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f447012%2ftwo-images-one-on-the-other%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            One-line joke