Saving GIF anims with transparency
Posted: Mon Mar 27, 2017 6:31 pm
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.
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