from __future__ import print_function
import sys
from PIL import Image

for infile in sys.argv[1:]:
    try:
        im = Image.open(infile)
        print(infile, im.format, '%dx%d' % im.size, im.mode)
    except IOError:
        pass
box = im.copy()
box = (0, 0, 40, 20)
region = im.crop(box)
region = region.transpose(Image.ROTATE_180)
im.paste(region, box)
im.save('test.jpg')
im.show()

168ca18c02f47469b6bb4c1f108e584b5cbf322c
<mask token>

<mask token>
for infile in sys.argv[1:]:
    try:
        im = Image.open(infile)
        print(infile, im.format, '%dx%d' % im.size, im.mode)
    except IOError:
        pass
<mask token>
im.paste(region, box)
im.save('test.jpg')
im.show()

<mask token>
for infile in sys.argv[1:]:
    try:
        im = Image.open(infile)
        print(infile, im.format, '%dx%d' % im.size, im.mode)
    except IOError:
        pass
box = im.copy()
box = 0, 0, 40, 20
region = im.crop(box)
region = region.transpose(Image.ROTATE_180)
im.paste(region, box)
im.save('test.jpg')
im.show()

from __future__ import print_function
import sys
from PIL import Image
for infile in sys.argv[1:]:
    try:
        im = Image.open(infile)
        print(infile, im.format, '%dx%d' % im.size, im.mode)
    except IOError:
        pass
box = im.copy()
box = 0, 0, 40, 20
region = im.crop(box)
region = region.transpose(Image.ROTATE_180)
im.paste(region, box)
im.save('test.jpg')
im.show()

from __future__ import print_function
import sys
from PIL import Image

for infile in sys.argv[1:]:
    try:
        im = Image.open(infile)
        print(infile, im.format, '%dx%d' % im.size, im.mode)
    except IOError:
        pass
box = im.copy()
box = (0, 0, 40, 20)
region = im.crop(box)
region = region.transpose(Image.ROTATE_180)
im.paste(region, box)
im.save('test.jpg')
im.show()
