You are here

Compare images

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

A script that compare images.

This script load two images files and create:

  • a layer "ref" with the first image
  • a layer "out" with the second image
  • a layer "col-diff" containing white pixels where colors are different between the two images
  • a layer "alpha-diff" containing white pixels where alpha is different between the two images
  • a layer "diff" containing white pixel when either colors or alpha are different
  • an optional layer "grown-diff" where the white regions in "diff" layer have grown by a given amount of pixels

Edit 2011-12-04: I have modified the script so that it runs in gimp 2.7 without any warning about deprecated functions. I have also attached two input files that can be used to test the script diff_pictures_tests_ref.png and diff_pictures_tests_out.png. The expected output with grow=0 is diff_pictures_tests_result_grow0.png and with grow=1 diff_pictures_tests_result_grow1.png.

Edit 2011-12-05: I have modified the script so that user setting such as background color or select by color parameters are no more modified by the execution of the script. The gimp context push and pop calls were missing.

Code License: 
GIMP Version: 
Scripting Engine: 

Comments

Seems to be cool, but not 2.7 compatible: gimp-image-add-layer, gimp-drawable-set-name...
I tried to "fix" it, but very quickly; you should check whether I understood everything (2.7 versions may no longer work on 2.6):
https://www.yousendit.com/download/T2dlcmxaYUlxRTI1aWNUQw
Seems to work properly on my Win 7 64 machine with 2.7.4 64-bit by Partha.
Among several changes, I replaced:
(gimp-selection-layer-alpha lay1)
with:
(gimp-image-select-item image CHANNEL-OP-ADD lay1)
You should check whether it is what you meant.

I've updated the script so that it can work in both gimp 2.6 and gimp 2.7 without any warning about deprecated functions. I've also attached test pictures and expected result of their comparison.

Gimp-2.6.11 and Gimp-2.7.4 for Widows 32 bit. :)
Thanks!

I'm downloading a 2.7 build of gimp from http://www.partha.com/.
I'll try to make it work for 2.7. If it is not possible to have a version of the script that works in both 2.6 & 2.7 I'll attach a 2.7 only version of it.

Thanks for noticing me about this issue.

Subscribe to Comments for "Compare images"