[Image-SIG] Colorize an image

Matthew Nuzum newz at bearfruit.org
Wed Jan 3 00:52:01 CET 2007


On 1/2/07, Joey Marshall <marshallpenguin at gmail.com> wrote:
>
> Hello,
> I am having a difficulty with developing my game. I would like to
> colorize the outfits on my penguins
> (http://joey101.net/projects/snowballz/). I have them separated out to
> make it easier to colorize... but I haven't been able to figure out
> how to.
>
> I already have PIL as a dependency for snowballz so I would like to
> use it, but there is nothing in PIL to do this easily. Does anyone
> know how to colorize an image? (all images are (RGBA) in red and I
> would like to be able to use a color like: (0,0,255) to colorize it
> to)
>
>
You will likely get much better answers from others on the list, but I've
done it once. I experimented with a few different techniques and I did it
simply as an experiment. I took my images in photoshop, made them black and
white (er, actually, black and transparent) by grabbing the channel that had
the appearance and deleting all the other channels. I then saved it out as a
png with alpha transparency. That's a quick overview of how I got my png,
use whatever technique works for you.

Once I had my image, I loaded it into PIL and figured out the dimensions. I
then created a new image and set its color to red or orange or whatever I
wanted. Then I overlaid my image with alpha transparency onto the new image.

I can't remember exactly what I did and I'm looking for the source and can't
find it easily. However, the concept is pretty simple and you likely already
know how to do all of that stuff anyway.
-- 
Matthew Nuzum
www.bearfruit.org
newz2000 on freenode
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/image-sig/attachments/20070102/6b0b8ebc/attachment.htm 


More information about the Image-SIG mailing list