Alpha channel in JPEG's
Andreas Raab
andreas.raab at gmx.de
Sun Jan 12 23:16:39 UTC 2003
> 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?
Err ... not sure what you are asking for. How's this:
form1 := Form fromFileNamed: 'image1.png'.
form2 := Form fromFileNamed: 'image2.png'.
form1 displayOn: form2 at: 0 at 0 rule: Form blend.
form2 display.
Cheers,
- Andreas
> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On
> Behalf Of Nevin Pratt
> Sent: Sunday, January 12, 2003 10:26 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Re: Alpha channel in JPEG's
>
>
> 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.
>
> Nevin
>
>
> Andreas Raab wrote:
>
> >Nevin,
> >
> >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.
> >
> >Cheers,
> > - Andreas
> >
> >
> >
> >>
> >>
>
>
>
More information about the Squeak-dev
mailing list
|