Sign in to follow this  
Awesome_Taco

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: https://twitter.com/teamspeak
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 = Image.open('1.jpg')
image_two = Image.open('2.jpg')
image_three = Image.open('3.jpg')
image_four = Image.open('4.jpg')
image_five = Image.open('5.jpg')
image_six = Image.open('6.jpg')
image_seven = Image.open('7.jpg')
image_eight = Image.open('8.jpg')
image_nine = Image.open('9.jpg')
image_ten = Image.open('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)
 
diff10.save('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:

image.png.60d655fac434f974a07708bb34e980b8.png

Share this post


Link to post
Share on other sites
Guest
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