Saving GIF anims with transparency

Report any Hollywood bugs here
Post Reply
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Saving GIF anims with transparency

Post by jPV »

I can't seem to be able to save GIF anims with the wanted transparent color. Some "random" color gets the transparency always. Actually it seems that the "random" color is the last used color from the palette, or so... at least it seemed like that when I was looking the resulted animation with GIF-Toolkit. The resulting transparent color is always the same no matter what I try to define with the Transparency option.

And second issue, #ATTRTRANSPARENTCOLOR attribute gives always -1 even if I load existing animation with working transparency.

Code: Select all

LoadAnim(1,"Hollywood:Examples/Hollywood/Epiphany/gearsbig.gif")
DisplayAnimFrame(1,0,0,1)
SaveAnim(1,"ram:test.gif", #ANMFMT_GIF, {Transparency=$3432F4}) ; let's try to make the blue gear transparent
FreeAnim(1)
LoadAnim(1,"ram:test.gif", {LoadTransparency=True})
DebugPrint(GetAttribute(#ANIM,1,#ATTRTRANSPARENTCOLOR)) ; this seems to give -1 always
WaitLeftMouse
Cls
DisplayAnimFrame(1,0,0,1) ; some red color gets transparent, last of the used colors in the palette?
WaitLeftMouse
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving GIF anims with transparency

Post by airsoftsoftwair »

Hmm, true, I'll fix this, thanks for reporting!
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving GIF anims with transparency

Post by airsoftsoftwair »

Code: Select all

- Fix: When saving a GIF ANIM whose frames didn't have to be quantized because they fit into
  desired number of colors, the transparency pen wasn't set correctly
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving GIF anims with transparency

Post by airsoftsoftwair »

And second issue, #ATTRTRANSPARENTCOLOR attribute gives always -1 even if I load existing animation with working transparency.
That's normal behaviour. #ATTRTRANSPARENTCOLOR is currently only supported for RGB colors specified when loading an object using the "Transparency" tag. The special "LoadTransparency" tag currently isn't compatible with #ATTRTRANSPARENTCOLOR because in a palette image an RGB color isn't a reliable transparency because it could be in there several times in different pens.
Post Reply