Python Challenge – level 11 solution

The image is mixed 2 pictures. The darker one has the answer.
The following code is for the one which has answer. The other picture was produced by the code just switching the arguments of the 2 getpixel sentences.

import Image, ImageDraw

im ='cave.jpg')
draw = ImageDraw.Draw(im)
for j in range(im.size[1] / 2):
    for i in range(im.size[0] - 2):
        if i % 2 == 0:
            im.putpixel((i, j), im.getpixel((i, j*2)))
            im.putpixel((i, j), im.getpixel(i, j*2 + 1))'cave3.jpg')


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s