[GRLUG] GRMobile Dev/GRLUG/GRMakers Wednesday Nov 14th @ The Warehouse
Adam Tauno Williams
awilliam at whitemice.org
Wed Nov 14 11:38:12 EST 2012
On Wed, 2012-11-14 at 11:00 -0500, Matt Michielsen wrote:
> The intention is to print sets of images onto a page for cutting and
> giving away to the people in the pictures. I was thinking of doing
> vertical strips of 4 images and however many of those I can get onto
> an 8.5x11 sheet.
I have a Tomboy note relating to tiling images, it has psuedo-code of:
from PIL import Image
wfile = open('myfile.jpg', 'wb')
x = Image.new("RGBA", (w,h), color)
for i in images:
i.thumbnail((desiredw,desiredh), Image.ANTIALIAS)
x1, y1 = figure-out-the-placement
x.paste(i, (x1, y1))
x.save(wfile, "JPEG")
Note that while is seems odd the thumbail method generally produces
better results than resize; or did under whatever version I dested with.
There is an example of some working thumbnailing [but not tiling] PIL
code @
<http://sourceforge.net/p/coils/code/ci/d44e4be21f92b304d654251f792d6900455bf05a/tree/coils/net/ossf/thumbnail.py>
More information about the grlug
mailing list