Sign in to follow this  

Python Script to find and merge differences

Recommended Posts

I was bored at work and saw a nice challenge of putting together (a not so hard) puzzle for the new TeamSpeak 5. 

On their twitter:
There are puzzle images of what we are to believe is the next teamspeak UI. 

I thought it would be fun to have Python do the work for me. 

So it is quick and dirty but should still make sense. 


from PIL import Image, ImageChops
image_one ='1.jpg')
image_two ='2.jpg')
image_three ='3.jpg')
image_four ='4.jpg')
image_five ='5.jpg')
image_six ='6.jpg')
image_seven ='7.jpg')
image_eight ='8.jpg')
image_nine ='9.jpg')
image_ten ='10.jpg')
diff = ImageChops.difference(image_one, image_two)
diff2 = ImageChops.difference(diff, image_three)
diff3 = ImageChops.difference(diff2, image_four)
diff4 = ImageChops.difference(diff3, image_five)
diff5 = ImageChops.difference(diff4, image_six)
diff6 = ImageChops.difference(diff5, image_seven)
diff7 = ImageChops.difference(diff6, image_eight)
diff8 = ImageChops.difference(diff7, image_nine)
diff9 = ImageChops.difference(diff8, image_ten)

diff10 = ImageChops.invert(diff9)'diff.jpg')

They have 10 images at the time I wrote this, so we are missing 2 more. I named them in order, not really necessary, you can create an empty folder and just have it open all images in directory with a loop.


Here is the result:


Share this post

Link to post
Share on other sites
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this