RE: Re: associated alpha

"davidk" <[email protected]> Fri, 11 Feb 2005 02:18:18 -0500
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
As I understand this, Photoshop transparency is managed with
associated/premultiplied alpha. Photoshop also has a separate
"channels" palette where you can have an unlimited number of
masks (Red, Green, Blue, Alpha 1, Alpha 2, etc). Channels have
many uses in Photoshop besides transparency, but if you want to
use them to create a transparent image, here's how to do it:

- double click the background layer
- make "Layer 0" (this unlocks the backround layer)
- use the Select->Load Selection command.
- select an alpha Channel and check Invert.
- go to Edit->Cut

It seems to make sense that TIFF unassociated alphas would be be
converted to Photoshop channels, since Photoshop channels are just
masks (like unassociated alphas) that can be saved with an image.

Now as for colormapped images (whether Photoshop, PNG, etc), they
just aren't supposted to have associated alpha. I understand that
files created with Imagemagick/Graphicsmagick were set incorrectly.
Can we assume that all colormapped images with an associated alpha
were marked that way by mistake, and just not pre-multiply?

If it isn't a colormapped image, I think you're right to pre-multiply 
pixel data when saving the associated alpha type, and attempt to
reverse as best as possible on the way in. I like this idea:
-define tiff:alpha={associated|unassociated|undefined}
On import, it would override the alpha typed marked in the file.
On export, it would pre-multiply whenever marked as associated.

David


-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Bob
Friesenhahn
Sent: Wednesday, February 09, 2005 7:50 PM
To: [email protected]
Subject: Re: [GM-core] Re: associated alpha


I am still thinking about what to do about associated alpha and TIFF. 
For various reasons, GraphicsMagick does not handle alpha the same way 
that Photoshop does.  TIFF's associated alpha works the way Photoshop 
does, and Photoshop doesn't seem to want to have things any other way.

At this time, it seems that the only truely viable solution is to 
pre-multiply the pixel data on the way out, using the associated 
alpha.  The process would need to be reversed (as best possible) when 
an image is read which uses associated alpha.

Since GraphicsMagick does not use pre-multiplied alpha internally, it 
is able to store full color in pixels which are otherwise completely 
transparent.  With pre-multiplied alpha, entirely transparent pixels 
are converted to absolute black so there is no way to recover the 
original color value.

With pre-multiplied alpha, colormapped images become a problem since 
the existing colormap color values need to be pre-multiplied.  This 
essentially means that the image would need to be converted to 
DirectClass, pre-multiplied, and then color-reduced (if desired) 
again.

Bob
======================================
Bob Friesenhahn
[email protected]
http://www.simplesystems.org/users/bfriesen


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Graphicsmagick-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-core


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click