Skip to content

Instantly share code, notes, and snippets.

@charly24
Created March 21, 2014 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charly24/9682050 to your computer and use it in GitHub Desktop.
Save charly24/9682050 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import Image
img = Image.new('RGB', (480, 480), (0xff, 0xff, 0xff))
a = Image.open('A.bmp')
b = Image.open('B.bmp')
a.thumbnail((240, 240), Image.ANTIALIAS)
b.thumbnail((240, 240), Image.ANTIALIAS)
img.paste(a, (40, (480 - a.size[1]) / 2))
img.paste(b, (230, (480 - b.size[1]) / 2))
#img.show()
img.save('AB.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment