Alpha channel in JPEG's

Nevin Pratt nevin at
Sun Jan 12 21:26:10 UTC 2003

OK.  Sounds like I've got a bit to learn.

Off hand, though, I don't think the picture format on disk is going to 
matter, as long as I can read the pictures into a Squeak image and 
overlay one on top of another, with the top one having a transparant 
portion so that the bottom one shows through at the transparant areas. 
 Then, once the overlay happens, it can become "one" picture again 
inside the Squeak image, ready for the next overlay.

So, on disk, it sounds like PNG is the file format for this.

Got any tips on the Squeak end on how to read PNG's, putting one PNG 
over top of another to form a new picture?

Or am I still "up in the night", "all wet", or "a greenie", etc., as 
they say :-)

Thanks for your input.


Andreas Raab wrote:

>JPEG does not support transparency at all. You can work around this by
>using various techniques but "overlaying transparent JPEGs" will simply
>not work (never has, and probably never will). Here are a few things
>that can be done:
>* Use PNG - it supports transparency (doesn't compress as well though)
>* Use a separate image encoding the transparency as gray scale. In this
>case you could use either GIF or PNG (for masks with very few alpha
>levels) or even JPEG itself (for masks with very many alpha levels).
>In any case don't expect anyone to "add transparency to JPEG". This
>isn't even part of the spec.
>  - Andreas

More information about the Squeak-dev mailing list