Does “diff” exist for images?












46














You can compare two text files very easy with diff and even better with meld:



example meld



If you use diff for images, you get an example like this:



$ diff zivi-besch.tif zivildienst.tif 
Binary files zivi-besch.tif and zivildienst.tif differ


Here is an example:



Original from http://commons.wikimedia.org/wiki/File:Tux.svg



Original image



Edited:



edited



I've added a white background to both images and applied GIMPs "Difference" filter to get this:



difference



It is a very simple method how a diff could work, but I can imagine much better (and more complicated) ones.



Do you know a program which works for images like meld does for texts?



(If a program existed that could give a percentage (0% the same image - 100% the same image) I would also be interested in it, but I am looking for one that gives me visual hints where differences are.)










share|improve this question
























  • It appears you are linking to an SVG image. It is actually valid XML text. The same does not go for other image formats.
    – hexafraction
    Oct 30 '12 at 11:30










  • related: stackoverflow.com/questions/5132749/…
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    Nov 30 '18 at 15:09
















46














You can compare two text files very easy with diff and even better with meld:



example meld



If you use diff for images, you get an example like this:



$ diff zivi-besch.tif zivildienst.tif 
Binary files zivi-besch.tif and zivildienst.tif differ


Here is an example:



Original from http://commons.wikimedia.org/wiki/File:Tux.svg



Original image



Edited:



edited



I've added a white background to both images and applied GIMPs "Difference" filter to get this:



difference



It is a very simple method how a diff could work, but I can imagine much better (and more complicated) ones.



Do you know a program which works for images like meld does for texts?



(If a program existed that could give a percentage (0% the same image - 100% the same image) I would also be interested in it, but I am looking for one that gives me visual hints where differences are.)










share|improve this question
























  • It appears you are linking to an SVG image. It is actually valid XML text. The same does not go for other image formats.
    – hexafraction
    Oct 30 '12 at 11:30










  • related: stackoverflow.com/questions/5132749/…
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    Nov 30 '18 at 15:09














46












46








46


16





You can compare two text files very easy with diff and even better with meld:



example meld



If you use diff for images, you get an example like this:



$ diff zivi-besch.tif zivildienst.tif 
Binary files zivi-besch.tif and zivildienst.tif differ


Here is an example:



Original from http://commons.wikimedia.org/wiki/File:Tux.svg



Original image



Edited:



edited



I've added a white background to both images and applied GIMPs "Difference" filter to get this:



difference



It is a very simple method how a diff could work, but I can imagine much better (and more complicated) ones.



Do you know a program which works for images like meld does for texts?



(If a program existed that could give a percentage (0% the same image - 100% the same image) I would also be interested in it, but I am looking for one that gives me visual hints where differences are.)










share|improve this question















You can compare two text files very easy with diff and even better with meld:



example meld



If you use diff for images, you get an example like this:



$ diff zivi-besch.tif zivildienst.tif 
Binary files zivi-besch.tif and zivildienst.tif differ


Here is an example:



Original from http://commons.wikimedia.org/wiki/File:Tux.svg



Original image



Edited:



edited



I've added a white background to both images and applied GIMPs "Difference" filter to get this:



difference



It is a very simple method how a diff could work, but I can imagine much better (and more complicated) ones.



Do you know a program which works for images like meld does for texts?



(If a program existed that could give a percentage (0% the same image - 100% the same image) I would also be interested in it, but I am looking for one that gives me visual hints where differences are.)







image-processing diff






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 17 '14 at 9:04









Braiam

51.4k20136220




51.4k20136220










asked Oct 30 '12 at 9:29









Martin Thoma

6,439155172




6,439155172












  • It appears you are linking to an SVG image. It is actually valid XML text. The same does not go for other image formats.
    – hexafraction
    Oct 30 '12 at 11:30










  • related: stackoverflow.com/questions/5132749/…
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    Nov 30 '18 at 15:09


















  • It appears you are linking to an SVG image. It is actually valid XML text. The same does not go for other image formats.
    – hexafraction
    Oct 30 '12 at 11:30










  • related: stackoverflow.com/questions/5132749/…
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    Nov 30 '18 at 15:09
















It appears you are linking to an SVG image. It is actually valid XML text. The same does not go for other image formats.
– hexafraction
Oct 30 '12 at 11:30




It appears you are linking to an SVG image. It is actually valid XML text. The same does not go for other image formats.
– hexafraction
Oct 30 '12 at 11:30












related: stackoverflow.com/questions/5132749/…
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Nov 30 '18 at 15:09




related: stackoverflow.com/questions/5132749/…
– Ciro Santilli 新疆改造中心 六四事件 法轮功
Nov 30 '18 at 15:09










4 Answers
4






active

oldest

votes


















50














Yes, such a program exists!



ImageMagick has the compare utility, which has several ways of comparing images.



To install it:



sudo apt-get install imagemagick imagemagick-doc


Comparing two images visually:



compare -compose src tux_orig.png tux_modified.png tux_difference.png


tux_orig.png & tux_modified.png



tux_orig.pngtux_modified.png



Gives this image:



The image difference



Comparing two images via metrics:



There are also many ways to output the differences via some metrics, e.g.:



# compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
Image: tux_orig.png
Channel distortion: PSNR
red: 19.5485
green: 19.5973
blue: 19.6507
alpha: 16.1568
all: 18.4517
tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020


Some metric options:



AE     absolute error count, number of different pixels (-fuzz effected)
FUZZ mean color distance
MAE mean absolute error (normalized), average channel error distance
MEPP mean error per pixel (normalized mean error, normalized peak error)
MSE mean error squared, average of the channel error squared
NCC normalized cross correlation
PAE peak absolute (normalize peak absolute)
PSNR peak signal to noise ratio
RMSE root mean squared (normalized root mean squared)


There are many ways to compare images, see ImageMagicks section on compare for further methods.






share|improve this answer





















  • Is there a way to merge? Or patch the difference to the original to get the target?
    – CMCDragonkai
    May 19 '16 at 13:58










  • @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
    – HRJ
    Jul 20 '16 at 10:17






  • 1




    imagemagick is really a magic !
    – Brain90
    Nov 24 '16 at 16:30










  • How about using compare with AE, but without generating a difference image?
    – user643722
    Nov 19 '18 at 17:23



















4














This question was ask back in 2012, and it's 2017. We now have the non-open-source program Beyond Compare to compare images, and it integrates into Nautilus. We have also had Geeqie all along for finding similar images throughout a directory structure (recursively).



I. Finding Image Differences With Beyond Compare



Click this link to download Beyond Compare .deb packages.



Install the package by going to the directory you downloaded the package too, and typing: sudo dpkg -i YourPackageName.deb which at this moment is called bcompare-4.2.2.22384_amd64.deb, so you would type: sudo dpkg -i bcompare-4.2.2.22384_amd64.deb



To complete the install and get the plugin to work in Nautilus, you will need to log out, and then back in, because Nautilus is running in the background even if you don't have it open.



Once it is installed and the plugin is working properly, you:




  1. Open Nautilus, and browse to the first image

  2. Right-click the first image to bring up the context menu, and select Select Left File for Compare/Merge

  3. Browse to the second image

  4. Right-click the second image, and select Compare to 'NameOfFirstImageFile' where NameOfFirstImageFile is the name of the file you selected in step 2.

  5. The images will then open up in Beyond Compare, and it will look something like this:


Beyond Compare Image Comparison



II. Finding Similar/Duplicate Images With Geeqie




  1. Install Geeqie by tying this into a terminal: sudo apt install geeqie

  2. Open Geeqie, and browse to the directory you want to scan.

  3. Right-click the name of the directory you want to scan and select Find duplicates... to just scan that directory, or select Find duplicates recursive... to scan that directory and all directories under it.


enter image description here




  1. Using the Compare by drop-down list in the lower left corner, you can choose to find duplicates by Checksum, by Filename, or by Similarity levels. The similarity feature is awesome if you have cropped, rotated, or resized images, you no longer need, as many of us acquire, when we crop/resize pictures to post on social media and such.






share|improve this answer































    2















    1. There is command idiff in package openimageio-tools.

    2. There is command perceptualdiff (package perceptualdiff).

    3. There is command uprightdiff (package uprightdiff).






    share|improve this answer































      0














      I ended up with the following:



      ~/.gitconfig



      Append



      [diff "image"]
      command = simple-imagediff


      simple-imagediff



      I've added the following to ~/.local/bin/simple-imagediff:



      #!/usr/bin/env python

      # Simple Image Diffs
      # ==================
      #
      # How to Install
      # --------------
      #
      # Download the script somewhere on $PATH as 'simple-imagediff' with +x:
      #
      # $ cd ~/bin
      # $ wget -O simple-imagediff https://raw.github.com/gist/1716699/simple-imagediff.py
      # $ chmod +x simple-imagediff
      #
      # Prerequisites
      # -------------
      #
      # The script should work out-of-the box on Ubuntu 11.10. On other OS'es you may
      # need to install PIL and Gtk3.
      #
      # Git Setup
      # ---------
      #
      # In ~/.gitconfig, add:
      #
      # [diff "image"]
      # command = simple-imagediff
      #
      # In your project, create .gitattributes file and add (this enables the custom
      # diff tool above):
      #
      # *.gif diff=image
      # *.jpg diff=image
      # *.png diff=image
      #
      # Try It
      # ------
      #
      # $ git diff path/to/file.png
      #
      # NOTE: file.png must be versioned and the working copy must be different.

      import os
      import sys

      import Image

      from gi.repository import Gdk, Gtk


      class SimpleImageDiffWindow(Gtk.Window):
      def __init__(self, left, right):
      Gtk.Window.__init__(self,
      title="Simple Image Diff (%s, %s)" % (left, right))
      self.set_default_size(640, 480)
      align = Gtk.Alignment()
      align.set_padding(10, 10, 10, 10)
      box = Gtk.HBox(homogeneous=True, spacing=10)
      box.add(self._create_image_box(left))
      box.add(self._create_image_box(right))
      align.add(box)
      self.add(align)
      self.resize(1, 1)
      self.set_position(Gtk.WindowPosition.CENTER)

      def _create_image_box(self, image_file):
      box = Gtk.VBox(spacing=10)
      frame = Gtk.Frame()
      image = Gtk.Image()
      image.set_from_file(image_file)
      title = Gtk.Label(label="W: %dpx | H: %dpx" %
      Image.open(image_file).size)
      frame.add(image)
      box.pack_start(frame, True, True, 0)
      box.pack_end(title, False, False, 10)
      return box


      def _halt(message, code):
      sys.stderr.write("[ERROR] %sn" % message)
      sys.exit(0 << code)


      def _verify_file_exists(target):
      if not os.path.exists(target):
      _halt("The file '%s' does not exists." % target, 2)

      if __name__ == '__main__':
      if len(sys.argv) < 3:
      _halt('Not enough arguments.', 1)
      _verify_file_exists(sys.argv[1])
      _verify_file_exists(sys.argv[2])
      app = SimpleImageDiffWindow(sys.argv[1], sys.argv[2])
      app.connect('delete-event', Gtk.main_quit)
      app.show_all()
      Gtk.main()





      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        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',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f209517%2fdoes-diff-exist-for-images%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        50














        Yes, such a program exists!



        ImageMagick has the compare utility, which has several ways of comparing images.



        To install it:



        sudo apt-get install imagemagick imagemagick-doc


        Comparing two images visually:



        compare -compose src tux_orig.png tux_modified.png tux_difference.png


        tux_orig.png & tux_modified.png



        tux_orig.pngtux_modified.png



        Gives this image:



        The image difference



        Comparing two images via metrics:



        There are also many ways to output the differences via some metrics, e.g.:



        # compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
        tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
        tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
        Image: tux_orig.png
        Channel distortion: PSNR
        red: 19.5485
        green: 19.5973
        blue: 19.6507
        alpha: 16.1568
        all: 18.4517
        tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020


        Some metric options:



        AE     absolute error count, number of different pixels (-fuzz effected)
        FUZZ mean color distance
        MAE mean absolute error (normalized), average channel error distance
        MEPP mean error per pixel (normalized mean error, normalized peak error)
        MSE mean error squared, average of the channel error squared
        NCC normalized cross correlation
        PAE peak absolute (normalize peak absolute)
        PSNR peak signal to noise ratio
        RMSE root mean squared (normalized root mean squared)


        There are many ways to compare images, see ImageMagicks section on compare for further methods.






        share|improve this answer





















        • Is there a way to merge? Or patch the difference to the original to get the target?
          – CMCDragonkai
          May 19 '16 at 13:58










        • @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
          – HRJ
          Jul 20 '16 at 10:17






        • 1




          imagemagick is really a magic !
          – Brain90
          Nov 24 '16 at 16:30










        • How about using compare with AE, but without generating a difference image?
          – user643722
          Nov 19 '18 at 17:23
















        50














        Yes, such a program exists!



        ImageMagick has the compare utility, which has several ways of comparing images.



        To install it:



        sudo apt-get install imagemagick imagemagick-doc


        Comparing two images visually:



        compare -compose src tux_orig.png tux_modified.png tux_difference.png


        tux_orig.png & tux_modified.png



        tux_orig.pngtux_modified.png



        Gives this image:



        The image difference



        Comparing two images via metrics:



        There are also many ways to output the differences via some metrics, e.g.:



        # compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
        tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
        tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
        Image: tux_orig.png
        Channel distortion: PSNR
        red: 19.5485
        green: 19.5973
        blue: 19.6507
        alpha: 16.1568
        all: 18.4517
        tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020


        Some metric options:



        AE     absolute error count, number of different pixels (-fuzz effected)
        FUZZ mean color distance
        MAE mean absolute error (normalized), average channel error distance
        MEPP mean error per pixel (normalized mean error, normalized peak error)
        MSE mean error squared, average of the channel error squared
        NCC normalized cross correlation
        PAE peak absolute (normalize peak absolute)
        PSNR peak signal to noise ratio
        RMSE root mean squared (normalized root mean squared)


        There are many ways to compare images, see ImageMagicks section on compare for further methods.






        share|improve this answer





















        • Is there a way to merge? Or patch the difference to the original to get the target?
          – CMCDragonkai
          May 19 '16 at 13:58










        • @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
          – HRJ
          Jul 20 '16 at 10:17






        • 1




          imagemagick is really a magic !
          – Brain90
          Nov 24 '16 at 16:30










        • How about using compare with AE, but without generating a difference image?
          – user643722
          Nov 19 '18 at 17:23














        50












        50








        50






        Yes, such a program exists!



        ImageMagick has the compare utility, which has several ways of comparing images.



        To install it:



        sudo apt-get install imagemagick imagemagick-doc


        Comparing two images visually:



        compare -compose src tux_orig.png tux_modified.png tux_difference.png


        tux_orig.png & tux_modified.png



        tux_orig.pngtux_modified.png



        Gives this image:



        The image difference



        Comparing two images via metrics:



        There are also many ways to output the differences via some metrics, e.g.:



        # compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
        tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
        tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
        Image: tux_orig.png
        Channel distortion: PSNR
        red: 19.5485
        green: 19.5973
        blue: 19.6507
        alpha: 16.1568
        all: 18.4517
        tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020


        Some metric options:



        AE     absolute error count, number of different pixels (-fuzz effected)
        FUZZ mean color distance
        MAE mean absolute error (normalized), average channel error distance
        MEPP mean error per pixel (normalized mean error, normalized peak error)
        MSE mean error squared, average of the channel error squared
        NCC normalized cross correlation
        PAE peak absolute (normalize peak absolute)
        PSNR peak signal to noise ratio
        RMSE root mean squared (normalized root mean squared)


        There are many ways to compare images, see ImageMagicks section on compare for further methods.






        share|improve this answer












        Yes, such a program exists!



        ImageMagick has the compare utility, which has several ways of comparing images.



        To install it:



        sudo apt-get install imagemagick imagemagick-doc


        Comparing two images visually:



        compare -compose src tux_orig.png tux_modified.png tux_difference.png


        tux_orig.png & tux_modified.png



        tux_orig.pngtux_modified.png



        Gives this image:



        The image difference



        Comparing two images via metrics:



        There are also many ways to output the differences via some metrics, e.g.:



        # compare -verbose -metric PSNR tux_orig.png tux_modified.png tux_difference.png
        tux_orig.png PNG 200x232 200x232+0+0 8-bit sRGB 20.6KB 0.000u 0:00.000
        tux_modified.png PNG 200x232 200x232+0+0 8-bit sRGB 22.2KB 0.010u 0:00.000
        Image: tux_orig.png
        Channel distortion: PSNR
        red: 19.5485
        green: 19.5973
        blue: 19.6507
        alpha: 16.1568
        all: 18.4517
        tux_orig.png=>tux_difference.png PNG 200x232 200x232+0+0 8-bit sRGB 12.3KB 0.030u 0:00.020


        Some metric options:



        AE     absolute error count, number of different pixels (-fuzz effected)
        FUZZ mean color distance
        MAE mean absolute error (normalized), average channel error distance
        MEPP mean error per pixel (normalized mean error, normalized peak error)
        MSE mean error squared, average of the channel error squared
        NCC normalized cross correlation
        PAE peak absolute (normalize peak absolute)
        PSNR peak signal to noise ratio
        RMSE root mean squared (normalized root mean squared)


        There are many ways to compare images, see ImageMagicks section on compare for further methods.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 30 '12 at 10:39









        phoibos

        15.2k23543




        15.2k23543












        • Is there a way to merge? Or patch the difference to the original to get the target?
          – CMCDragonkai
          May 19 '16 at 13:58










        • @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
          – HRJ
          Jul 20 '16 at 10:17






        • 1




          imagemagick is really a magic !
          – Brain90
          Nov 24 '16 at 16:30










        • How about using compare with AE, but without generating a difference image?
          – user643722
          Nov 19 '18 at 17:23


















        • Is there a way to merge? Or patch the difference to the original to get the target?
          – CMCDragonkai
          May 19 '16 at 13:58










        • @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
          – HRJ
          Jul 20 '16 at 10:17






        • 1




          imagemagick is really a magic !
          – Brain90
          Nov 24 '16 at 16:30










        • How about using compare with AE, but without generating a difference image?
          – user643722
          Nov 19 '18 at 17:23
















        Is there a way to merge? Or patch the difference to the original to get the target?
        – CMCDragonkai
        May 19 '16 at 13:58




        Is there a way to merge? Or patch the difference to the original to get the target?
        – CMCDragonkai
        May 19 '16 at 13:58












        @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
        – HRJ
        Jul 20 '16 at 10:17




        @CMCDragonkai ImageMagick is very powerful. I don't know the exact invocation, but you can filter and chain operations on images, and create new ones. So I am pretty sure you could "merge" with an ImageMagick script.
        – HRJ
        Jul 20 '16 at 10:17




        1




        1




        imagemagick is really a magic !
        – Brain90
        Nov 24 '16 at 16:30




        imagemagick is really a magic !
        – Brain90
        Nov 24 '16 at 16:30












        How about using compare with AE, but without generating a difference image?
        – user643722
        Nov 19 '18 at 17:23




        How about using compare with AE, but without generating a difference image?
        – user643722
        Nov 19 '18 at 17:23













        4














        This question was ask back in 2012, and it's 2017. We now have the non-open-source program Beyond Compare to compare images, and it integrates into Nautilus. We have also had Geeqie all along for finding similar images throughout a directory structure (recursively).



        I. Finding Image Differences With Beyond Compare



        Click this link to download Beyond Compare .deb packages.



        Install the package by going to the directory you downloaded the package too, and typing: sudo dpkg -i YourPackageName.deb which at this moment is called bcompare-4.2.2.22384_amd64.deb, so you would type: sudo dpkg -i bcompare-4.2.2.22384_amd64.deb



        To complete the install and get the plugin to work in Nautilus, you will need to log out, and then back in, because Nautilus is running in the background even if you don't have it open.



        Once it is installed and the plugin is working properly, you:




        1. Open Nautilus, and browse to the first image

        2. Right-click the first image to bring up the context menu, and select Select Left File for Compare/Merge

        3. Browse to the second image

        4. Right-click the second image, and select Compare to 'NameOfFirstImageFile' where NameOfFirstImageFile is the name of the file you selected in step 2.

        5. The images will then open up in Beyond Compare, and it will look something like this:


        Beyond Compare Image Comparison



        II. Finding Similar/Duplicate Images With Geeqie




        1. Install Geeqie by tying this into a terminal: sudo apt install geeqie

        2. Open Geeqie, and browse to the directory you want to scan.

        3. Right-click the name of the directory you want to scan and select Find duplicates... to just scan that directory, or select Find duplicates recursive... to scan that directory and all directories under it.


        enter image description here




        1. Using the Compare by drop-down list in the lower left corner, you can choose to find duplicates by Checksum, by Filename, or by Similarity levels. The similarity feature is awesome if you have cropped, rotated, or resized images, you no longer need, as many of us acquire, when we crop/resize pictures to post on social media and such.






        share|improve this answer




























          4














          This question was ask back in 2012, and it's 2017. We now have the non-open-source program Beyond Compare to compare images, and it integrates into Nautilus. We have also had Geeqie all along for finding similar images throughout a directory structure (recursively).



          I. Finding Image Differences With Beyond Compare



          Click this link to download Beyond Compare .deb packages.



          Install the package by going to the directory you downloaded the package too, and typing: sudo dpkg -i YourPackageName.deb which at this moment is called bcompare-4.2.2.22384_amd64.deb, so you would type: sudo dpkg -i bcompare-4.2.2.22384_amd64.deb



          To complete the install and get the plugin to work in Nautilus, you will need to log out, and then back in, because Nautilus is running in the background even if you don't have it open.



          Once it is installed and the plugin is working properly, you:




          1. Open Nautilus, and browse to the first image

          2. Right-click the first image to bring up the context menu, and select Select Left File for Compare/Merge

          3. Browse to the second image

          4. Right-click the second image, and select Compare to 'NameOfFirstImageFile' where NameOfFirstImageFile is the name of the file you selected in step 2.

          5. The images will then open up in Beyond Compare, and it will look something like this:


          Beyond Compare Image Comparison



          II. Finding Similar/Duplicate Images With Geeqie




          1. Install Geeqie by tying this into a terminal: sudo apt install geeqie

          2. Open Geeqie, and browse to the directory you want to scan.

          3. Right-click the name of the directory you want to scan and select Find duplicates... to just scan that directory, or select Find duplicates recursive... to scan that directory and all directories under it.


          enter image description here




          1. Using the Compare by drop-down list in the lower left corner, you can choose to find duplicates by Checksum, by Filename, or by Similarity levels. The similarity feature is awesome if you have cropped, rotated, or resized images, you no longer need, as many of us acquire, when we crop/resize pictures to post on social media and such.






          share|improve this answer


























            4












            4








            4






            This question was ask back in 2012, and it's 2017. We now have the non-open-source program Beyond Compare to compare images, and it integrates into Nautilus. We have also had Geeqie all along for finding similar images throughout a directory structure (recursively).



            I. Finding Image Differences With Beyond Compare



            Click this link to download Beyond Compare .deb packages.



            Install the package by going to the directory you downloaded the package too, and typing: sudo dpkg -i YourPackageName.deb which at this moment is called bcompare-4.2.2.22384_amd64.deb, so you would type: sudo dpkg -i bcompare-4.2.2.22384_amd64.deb



            To complete the install and get the plugin to work in Nautilus, you will need to log out, and then back in, because Nautilus is running in the background even if you don't have it open.



            Once it is installed and the plugin is working properly, you:




            1. Open Nautilus, and browse to the first image

            2. Right-click the first image to bring up the context menu, and select Select Left File for Compare/Merge

            3. Browse to the second image

            4. Right-click the second image, and select Compare to 'NameOfFirstImageFile' where NameOfFirstImageFile is the name of the file you selected in step 2.

            5. The images will then open up in Beyond Compare, and it will look something like this:


            Beyond Compare Image Comparison



            II. Finding Similar/Duplicate Images With Geeqie




            1. Install Geeqie by tying this into a terminal: sudo apt install geeqie

            2. Open Geeqie, and browse to the directory you want to scan.

            3. Right-click the name of the directory you want to scan and select Find duplicates... to just scan that directory, or select Find duplicates recursive... to scan that directory and all directories under it.


            enter image description here




            1. Using the Compare by drop-down list in the lower left corner, you can choose to find duplicates by Checksum, by Filename, or by Similarity levels. The similarity feature is awesome if you have cropped, rotated, or resized images, you no longer need, as many of us acquire, when we crop/resize pictures to post on social media and such.






            share|improve this answer














            This question was ask back in 2012, and it's 2017. We now have the non-open-source program Beyond Compare to compare images, and it integrates into Nautilus. We have also had Geeqie all along for finding similar images throughout a directory structure (recursively).



            I. Finding Image Differences With Beyond Compare



            Click this link to download Beyond Compare .deb packages.



            Install the package by going to the directory you downloaded the package too, and typing: sudo dpkg -i YourPackageName.deb which at this moment is called bcompare-4.2.2.22384_amd64.deb, so you would type: sudo dpkg -i bcompare-4.2.2.22384_amd64.deb



            To complete the install and get the plugin to work in Nautilus, you will need to log out, and then back in, because Nautilus is running in the background even if you don't have it open.



            Once it is installed and the plugin is working properly, you:




            1. Open Nautilus, and browse to the first image

            2. Right-click the first image to bring up the context menu, and select Select Left File for Compare/Merge

            3. Browse to the second image

            4. Right-click the second image, and select Compare to 'NameOfFirstImageFile' where NameOfFirstImageFile is the name of the file you selected in step 2.

            5. The images will then open up in Beyond Compare, and it will look something like this:


            Beyond Compare Image Comparison



            II. Finding Similar/Duplicate Images With Geeqie




            1. Install Geeqie by tying this into a terminal: sudo apt install geeqie

            2. Open Geeqie, and browse to the directory you want to scan.

            3. Right-click the name of the directory you want to scan and select Find duplicates... to just scan that directory, or select Find duplicates recursive... to scan that directory and all directories under it.


            enter image description here




            1. Using the Compare by drop-down list in the lower left corner, you can choose to find duplicates by Checksum, by Filename, or by Similarity levels. The similarity feature is awesome if you have cropped, rotated, or resized images, you no longer need, as many of us acquire, when we crop/resize pictures to post on social media and such.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 22 '17 at 3:32

























            answered Jul 22 '17 at 2:57









            SunnyDaze

            86129




            86129























                2















                1. There is command idiff in package openimageio-tools.

                2. There is command perceptualdiff (package perceptualdiff).

                3. There is command uprightdiff (package uprightdiff).






                share|improve this answer




























                  2















                  1. There is command idiff in package openimageio-tools.

                  2. There is command perceptualdiff (package perceptualdiff).

                  3. There is command uprightdiff (package uprightdiff).






                  share|improve this answer


























                    2












                    2








                    2







                    1. There is command idiff in package openimageio-tools.

                    2. There is command perceptualdiff (package perceptualdiff).

                    3. There is command uprightdiff (package uprightdiff).






                    share|improve this answer















                    1. There is command idiff in package openimageio-tools.

                    2. There is command perceptualdiff (package perceptualdiff).

                    3. There is command uprightdiff (package uprightdiff).







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Dec 1 '18 at 17:16

























                    answered Sep 23 '17 at 19:30









                    Rudolf Dovičín

                    573




                    573























                        0














                        I ended up with the following:



                        ~/.gitconfig



                        Append



                        [diff "image"]
                        command = simple-imagediff


                        simple-imagediff



                        I've added the following to ~/.local/bin/simple-imagediff:



                        #!/usr/bin/env python

                        # Simple Image Diffs
                        # ==================
                        #
                        # How to Install
                        # --------------
                        #
                        # Download the script somewhere on $PATH as 'simple-imagediff' with +x:
                        #
                        # $ cd ~/bin
                        # $ wget -O simple-imagediff https://raw.github.com/gist/1716699/simple-imagediff.py
                        # $ chmod +x simple-imagediff
                        #
                        # Prerequisites
                        # -------------
                        #
                        # The script should work out-of-the box on Ubuntu 11.10. On other OS'es you may
                        # need to install PIL and Gtk3.
                        #
                        # Git Setup
                        # ---------
                        #
                        # In ~/.gitconfig, add:
                        #
                        # [diff "image"]
                        # command = simple-imagediff
                        #
                        # In your project, create .gitattributes file and add (this enables the custom
                        # diff tool above):
                        #
                        # *.gif diff=image
                        # *.jpg diff=image
                        # *.png diff=image
                        #
                        # Try It
                        # ------
                        #
                        # $ git diff path/to/file.png
                        #
                        # NOTE: file.png must be versioned and the working copy must be different.

                        import os
                        import sys

                        import Image

                        from gi.repository import Gdk, Gtk


                        class SimpleImageDiffWindow(Gtk.Window):
                        def __init__(self, left, right):
                        Gtk.Window.__init__(self,
                        title="Simple Image Diff (%s, %s)" % (left, right))
                        self.set_default_size(640, 480)
                        align = Gtk.Alignment()
                        align.set_padding(10, 10, 10, 10)
                        box = Gtk.HBox(homogeneous=True, spacing=10)
                        box.add(self._create_image_box(left))
                        box.add(self._create_image_box(right))
                        align.add(box)
                        self.add(align)
                        self.resize(1, 1)
                        self.set_position(Gtk.WindowPosition.CENTER)

                        def _create_image_box(self, image_file):
                        box = Gtk.VBox(spacing=10)
                        frame = Gtk.Frame()
                        image = Gtk.Image()
                        image.set_from_file(image_file)
                        title = Gtk.Label(label="W: %dpx | H: %dpx" %
                        Image.open(image_file).size)
                        frame.add(image)
                        box.pack_start(frame, True, True, 0)
                        box.pack_end(title, False, False, 10)
                        return box


                        def _halt(message, code):
                        sys.stderr.write("[ERROR] %sn" % message)
                        sys.exit(0 << code)


                        def _verify_file_exists(target):
                        if not os.path.exists(target):
                        _halt("The file '%s' does not exists." % target, 2)

                        if __name__ == '__main__':
                        if len(sys.argv) < 3:
                        _halt('Not enough arguments.', 1)
                        _verify_file_exists(sys.argv[1])
                        _verify_file_exists(sys.argv[2])
                        app = SimpleImageDiffWindow(sys.argv[1], sys.argv[2])
                        app.connect('delete-event', Gtk.main_quit)
                        app.show_all()
                        Gtk.main()





                        share|improve this answer




























                          0














                          I ended up with the following:



                          ~/.gitconfig



                          Append



                          [diff "image"]
                          command = simple-imagediff


                          simple-imagediff



                          I've added the following to ~/.local/bin/simple-imagediff:



                          #!/usr/bin/env python

                          # Simple Image Diffs
                          # ==================
                          #
                          # How to Install
                          # --------------
                          #
                          # Download the script somewhere on $PATH as 'simple-imagediff' with +x:
                          #
                          # $ cd ~/bin
                          # $ wget -O simple-imagediff https://raw.github.com/gist/1716699/simple-imagediff.py
                          # $ chmod +x simple-imagediff
                          #
                          # Prerequisites
                          # -------------
                          #
                          # The script should work out-of-the box on Ubuntu 11.10. On other OS'es you may
                          # need to install PIL and Gtk3.
                          #
                          # Git Setup
                          # ---------
                          #
                          # In ~/.gitconfig, add:
                          #
                          # [diff "image"]
                          # command = simple-imagediff
                          #
                          # In your project, create .gitattributes file and add (this enables the custom
                          # diff tool above):
                          #
                          # *.gif diff=image
                          # *.jpg diff=image
                          # *.png diff=image
                          #
                          # Try It
                          # ------
                          #
                          # $ git diff path/to/file.png
                          #
                          # NOTE: file.png must be versioned and the working copy must be different.

                          import os
                          import sys

                          import Image

                          from gi.repository import Gdk, Gtk


                          class SimpleImageDiffWindow(Gtk.Window):
                          def __init__(self, left, right):
                          Gtk.Window.__init__(self,
                          title="Simple Image Diff (%s, %s)" % (left, right))
                          self.set_default_size(640, 480)
                          align = Gtk.Alignment()
                          align.set_padding(10, 10, 10, 10)
                          box = Gtk.HBox(homogeneous=True, spacing=10)
                          box.add(self._create_image_box(left))
                          box.add(self._create_image_box(right))
                          align.add(box)
                          self.add(align)
                          self.resize(1, 1)
                          self.set_position(Gtk.WindowPosition.CENTER)

                          def _create_image_box(self, image_file):
                          box = Gtk.VBox(spacing=10)
                          frame = Gtk.Frame()
                          image = Gtk.Image()
                          image.set_from_file(image_file)
                          title = Gtk.Label(label="W: %dpx | H: %dpx" %
                          Image.open(image_file).size)
                          frame.add(image)
                          box.pack_start(frame, True, True, 0)
                          box.pack_end(title, False, False, 10)
                          return box


                          def _halt(message, code):
                          sys.stderr.write("[ERROR] %sn" % message)
                          sys.exit(0 << code)


                          def _verify_file_exists(target):
                          if not os.path.exists(target):
                          _halt("The file '%s' does not exists." % target, 2)

                          if __name__ == '__main__':
                          if len(sys.argv) < 3:
                          _halt('Not enough arguments.', 1)
                          _verify_file_exists(sys.argv[1])
                          _verify_file_exists(sys.argv[2])
                          app = SimpleImageDiffWindow(sys.argv[1], sys.argv[2])
                          app.connect('delete-event', Gtk.main_quit)
                          app.show_all()
                          Gtk.main()





                          share|improve this answer


























                            0












                            0








                            0






                            I ended up with the following:



                            ~/.gitconfig



                            Append



                            [diff "image"]
                            command = simple-imagediff


                            simple-imagediff



                            I've added the following to ~/.local/bin/simple-imagediff:



                            #!/usr/bin/env python

                            # Simple Image Diffs
                            # ==================
                            #
                            # How to Install
                            # --------------
                            #
                            # Download the script somewhere on $PATH as 'simple-imagediff' with +x:
                            #
                            # $ cd ~/bin
                            # $ wget -O simple-imagediff https://raw.github.com/gist/1716699/simple-imagediff.py
                            # $ chmod +x simple-imagediff
                            #
                            # Prerequisites
                            # -------------
                            #
                            # The script should work out-of-the box on Ubuntu 11.10. On other OS'es you may
                            # need to install PIL and Gtk3.
                            #
                            # Git Setup
                            # ---------
                            #
                            # In ~/.gitconfig, add:
                            #
                            # [diff "image"]
                            # command = simple-imagediff
                            #
                            # In your project, create .gitattributes file and add (this enables the custom
                            # diff tool above):
                            #
                            # *.gif diff=image
                            # *.jpg diff=image
                            # *.png diff=image
                            #
                            # Try It
                            # ------
                            #
                            # $ git diff path/to/file.png
                            #
                            # NOTE: file.png must be versioned and the working copy must be different.

                            import os
                            import sys

                            import Image

                            from gi.repository import Gdk, Gtk


                            class SimpleImageDiffWindow(Gtk.Window):
                            def __init__(self, left, right):
                            Gtk.Window.__init__(self,
                            title="Simple Image Diff (%s, %s)" % (left, right))
                            self.set_default_size(640, 480)
                            align = Gtk.Alignment()
                            align.set_padding(10, 10, 10, 10)
                            box = Gtk.HBox(homogeneous=True, spacing=10)
                            box.add(self._create_image_box(left))
                            box.add(self._create_image_box(right))
                            align.add(box)
                            self.add(align)
                            self.resize(1, 1)
                            self.set_position(Gtk.WindowPosition.CENTER)

                            def _create_image_box(self, image_file):
                            box = Gtk.VBox(spacing=10)
                            frame = Gtk.Frame()
                            image = Gtk.Image()
                            image.set_from_file(image_file)
                            title = Gtk.Label(label="W: %dpx | H: %dpx" %
                            Image.open(image_file).size)
                            frame.add(image)
                            box.pack_start(frame, True, True, 0)
                            box.pack_end(title, False, False, 10)
                            return box


                            def _halt(message, code):
                            sys.stderr.write("[ERROR] %sn" % message)
                            sys.exit(0 << code)


                            def _verify_file_exists(target):
                            if not os.path.exists(target):
                            _halt("The file '%s' does not exists." % target, 2)

                            if __name__ == '__main__':
                            if len(sys.argv) < 3:
                            _halt('Not enough arguments.', 1)
                            _verify_file_exists(sys.argv[1])
                            _verify_file_exists(sys.argv[2])
                            app = SimpleImageDiffWindow(sys.argv[1], sys.argv[2])
                            app.connect('delete-event', Gtk.main_quit)
                            app.show_all()
                            Gtk.main()





                            share|improve this answer














                            I ended up with the following:



                            ~/.gitconfig



                            Append



                            [diff "image"]
                            command = simple-imagediff


                            simple-imagediff



                            I've added the following to ~/.local/bin/simple-imagediff:



                            #!/usr/bin/env python

                            # Simple Image Diffs
                            # ==================
                            #
                            # How to Install
                            # --------------
                            #
                            # Download the script somewhere on $PATH as 'simple-imagediff' with +x:
                            #
                            # $ cd ~/bin
                            # $ wget -O simple-imagediff https://raw.github.com/gist/1716699/simple-imagediff.py
                            # $ chmod +x simple-imagediff
                            #
                            # Prerequisites
                            # -------------
                            #
                            # The script should work out-of-the box on Ubuntu 11.10. On other OS'es you may
                            # need to install PIL and Gtk3.
                            #
                            # Git Setup
                            # ---------
                            #
                            # In ~/.gitconfig, add:
                            #
                            # [diff "image"]
                            # command = simple-imagediff
                            #
                            # In your project, create .gitattributes file and add (this enables the custom
                            # diff tool above):
                            #
                            # *.gif diff=image
                            # *.jpg diff=image
                            # *.png diff=image
                            #
                            # Try It
                            # ------
                            #
                            # $ git diff path/to/file.png
                            #
                            # NOTE: file.png must be versioned and the working copy must be different.

                            import os
                            import sys

                            import Image

                            from gi.repository import Gdk, Gtk


                            class SimpleImageDiffWindow(Gtk.Window):
                            def __init__(self, left, right):
                            Gtk.Window.__init__(self,
                            title="Simple Image Diff (%s, %s)" % (left, right))
                            self.set_default_size(640, 480)
                            align = Gtk.Alignment()
                            align.set_padding(10, 10, 10, 10)
                            box = Gtk.HBox(homogeneous=True, spacing=10)
                            box.add(self._create_image_box(left))
                            box.add(self._create_image_box(right))
                            align.add(box)
                            self.add(align)
                            self.resize(1, 1)
                            self.set_position(Gtk.WindowPosition.CENTER)

                            def _create_image_box(self, image_file):
                            box = Gtk.VBox(spacing=10)
                            frame = Gtk.Frame()
                            image = Gtk.Image()
                            image.set_from_file(image_file)
                            title = Gtk.Label(label="W: %dpx | H: %dpx" %
                            Image.open(image_file).size)
                            frame.add(image)
                            box.pack_start(frame, True, True, 0)
                            box.pack_end(title, False, False, 10)
                            return box


                            def _halt(message, code):
                            sys.stderr.write("[ERROR] %sn" % message)
                            sys.exit(0 << code)


                            def _verify_file_exists(target):
                            if not os.path.exists(target):
                            _halt("The file '%s' does not exists." % target, 2)

                            if __name__ == '__main__':
                            if len(sys.argv) < 3:
                            _halt('Not enough arguments.', 1)
                            _verify_file_exists(sys.argv[1])
                            _verify_file_exists(sys.argv[2])
                            app = SimpleImageDiffWindow(sys.argv[1], sys.argv[2])
                            app.connect('delete-event', Gtk.main_quit)
                            app.show_all()
                            Gtk.main()






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Apr 14 '17 at 8:57









                            muru

                            1




                            1










                            answered Apr 14 '17 at 8:51









                            Martin Thoma

                            6,439155172




                            6,439155172






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f209517%2fdoes-diff-exist-for-images%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How to change which sound is reproduced for terminal bell?

                                Can I use Tabulator js library in my java Spring + Thymeleaf project?

                                Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents