Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comparing pictures
#1
Hi I’m trying to compare two pictures and the objective is to illustrate changes from the original picture and the new picture. I have googled it to try to get some inspirations to how I should do this. All I seem to find are programs who highlights certain area which differs from the original picture, but I want my program to layer the pictures on top of each other and outline the difference. Any tips on how I can solve this? I´m a newbie btw :)
Reply
#2
If the images are layered on top of each other, then what does the difference look like?  Both of the images, blended together?
That part seems simple enough.  Load the images using something like pillow (https://python-pillow.org/), set the alpha channel of both to 50%, and overlay them both to the same output file.

Outline differences would mean thinking a little bit about what an image is.  For raster images, it's a collection of points/pixels, that have color values.  For vector images... you'd probably want to just convert them to raster images before attempting a comparison.  Then you'd iterate over each pixel in both files to find differences.

Things to think about:
- if one image is different from the other, but only by a few shades of red (so the difference is not noticeable), would that get outlined?
- if a handful of pixels next to each other are all different, are each of them outlined individually, or is the entire region given one big outline?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Find a shift between 2 pictures TazFleck 0 1,103 Jan-18-2023, 09:56 PM
Last Post: TazFleck
Photo put a green boarder and text around multiple pictures jackosullivan 5 1,402 Jul-05-2022, 10:39 AM
Last Post: snippsat
  Random pictures from a file aliwien 2 4,280 Apr-23-2021, 06:00 PM
Last Post: snippsat
  Help with taking pictures on raspberry pi octavia 1 1,662 Feb-07-2020, 04:54 PM
Last Post: Larz60+
  client-server pictures mcgrim 4 2,919 Oct-25-2019, 09:53 PM
Last Post: micseydel
  Open Pictures with Python MaxouRuEnIpTF34 1 3,002 Apr-22-2018, 07:48 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020