![]() | Ned Batchelder : Blog | Code | Text | Site Quick PIL tip » Home : Blog : January 2006 |
Quick PIL tipThursday 26 January 2006 Just a quick note: let's say you are using the Python Imaging Library to composite a number of images with borders into a larger image. The ImageDraw.rectangle method is fabulous for drawing borders. BUT: The ImageDraw.bitmap method is not what you want for putting little images onto the larger image. I don't what it is good for, but it isn't good for that. You want the Image.paste method. It works great. | |
Comments
fwiw, the "bitmap" method draws a bitmap (i.e. a 1-bit mask) in a given color. it's pretty much the same thing as "Image.paste(color, mask)"
That would be a great sentence to add to the documentation, along with, "If you want to draw an image on an image, use Image.paste()".
And what about ImageDraw.Draw?
ImageDraw.Draw is the constructor for draw objects, which have the bitmap() method that worked so poorly for me.
Add a comment: