Tips on how to Create a Diff of Two Photos

After I was a baby, I beloved in search of Waldo within the “The place’s Waldo?” guide sequence. Lately I am a sucker for TMZ’s “What is the Huge Frigin Distinction” photos, the place TMZ barely adjustments a picture and it’s a must to spot the variations between the 2. That bought me to pondering — how simply may I automate diff’ing two photos? This StackOverflow publish was gold.

To create a diff of two comparable photos, we’ll use ImageMagick’s convert command line utility with a big host of configurations:

convert '(' image1.png -flatten -grayscale Rec709Luminance ')' 
        '(' image2.png -flatten -grayscale Rec709Luminance ')' 
        '(' -clone 0-1 -compose darken -composite ')' 
        -channel RGB -combine diff.png

How efficient is that this command with its configuration arguments? Let’s take a look:

Unique Picture

Modified Picture

Diff’ed Picture

The diff picture result’s fairly informative! The dimensions of the sun shades is clearly introduced, and in case you look intently, you possibly can see one cranium on the top-right of the shirt has been flipped.

No matter your cause for eager to determine the distinction two photos, ImageMagick’s convert instrument is spectacular. You possibly can do 1,000,000 issues with ImageMagick; try my Media tutorials to be taught extra superior methods to change photos, movies, and audio!

  • Animating CSS3 Transforms with MooTools Fx
  • Responsive and Infinitely Scalable JS Animations

    Again in late 2012 it was not simple to search out open supply tasks utilizing requestAnimationFrame() – that is the hook that enables Javascript code to synchronize with an online browser’s native paint loop. Animations utilizing this methodology can run at 60 fps and ship improbable…

  • FileReader API

    As broadband velocity continues to get sooner, the net continues to be extra media-centric.  Generally that may be good (Netflix, different streaming providers), typically that may be dangerous (eager to learn a information article but it surely has an accompanying ineffective video with it).  And each social service does…

  • iPhone Click Effect Using MooTools or jQuery

    One factor I really like about love about Safari on the iPhone is that Safari supplies a darkened background impact whenever you click on a hyperlink. It is probably the most refined of particulars however simply enforces than an motion is happening. So why not implement that…

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles