Creating a new image from two old using PIL?

Fredrik Lundh effbot at telia.com
Wed Feb 2 12:40:35 EST 2000


Anders M Eriksson wrote:
> I'm a beginner of Python and I thought that I should create an web
> counter cgi. I have created the whole cgi except for the part that
> creates the image.
>
> For this I tried to use PIL, but I can't figure it out.
>
> How do I create a new image from two (or more) images?
>
> as everyone guesses the source images are the numbers 0 - 9 and I
> would like to create a new image that combines these images to the
> number I want to show on the html-page.

hints: use "Image.new" to create a blank image large enough
to hold the resulting image, and "paste" to paste the digits
into it.

also see "Cutting, Pasting and Merging Images" in the tutorial:
http://www.pythonware.com/library/pil/handbook/intro01.htm

</F>





More information about the Python-list mailing list