Re: Re: associated alpha

Bob Friesenhahn <[email protected]> Mon, 7 Feb 2005 22:52:58 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
On Sat, 5 Feb 2005, Glenn Randers-Pehrson wrote:

> At 11:57 AM 2/5/2005 -0600, Bob Friesenhahn wrote:
>>
>> Presumably this would then work
>>
>>   gm convert -define tiff:alpha=unassociated old.tiff \
>>              -define tiff:alpha=associated new.tiff
>
> Suppose old.tiff has unassociated alpha that is mismarked
> associated.  What happens?  old.tiff is read and the tag is
> changed to unassociated. OK so far.  Then new.tiff is written
> with the tag changed back to associated.  Eh?  This apparently
> would write out an identical (wrong) new.tiff == old.tiff.

I have not yet added any special -define to support this.

What I have done (in my copy) is add an image attribute to keep track 
of the alpha type.  I also added some code so that if 
ImageMagick/GraphicsMagick didn't create the associated-alpha image, 
then a warning is generated.  I experimented with automatically 
converting ImageMagick/GraphicsMagick generated images to unassociated 
type, but this has the problem that if an image with an real 
associated alpha channel is converted by GraphicsMagick, then the 
alpha channel is trashed and GraphicsMagick doesn't warn.

This is a real mess.  It seems that user intervention is required.

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