import boto
import io
import urllib.request, urllib.parse, urllib.error
import Image
fp = urllib.request.urlopen('http://example.com/test.png')
img = io.StringIO(fp.read())
im = Image.open(img)
im2 = im.resize((500, 100), Image.NEAREST)
out_im2 = io.StringIO()
im2.save(out_im2, 'PNG')
conn = boto.connect_s3()
b = conn.get_bucket('example')
k = b.new_key('example.png')
k.set_contents_from_string(out_im2.getvalue())
Upload resized image to S3