
Here's the C code. It's written to be compiled into a PYD using the Swig system, which is a whole nother story. The last routine, Mix, is the part that could be thrown directly into Python. The ShowBMP routine is sneaky and rather nasty; it plants a BMP into TKinter's Canvas without TK's knowledge. So a conversion into strict Python would still have to use some external way of showing the image; perhaps giving a command-line call to Irfan or something like that.
My python page
My ShareCG freebies