As the tittle says, many times we've needed to open an animated gif and manually coloring all the outline with a new color...normally black. I came up with a snippet that can do this in a less cumbersome way .I hope it can be useful for someone. This is what I have so far.
`our animation
load animation "skull.gif",1
play animation to image 1,50,0,0,128,160
rem loop animation 1
for t= 1 to 7
run=run+1
if run<8
paste image 50,0,0
endif
`filling the black area around the character with pure black. We could use "FILL COMMAND FROM MATRIX1 Utils"
if run<8
lock pixels
for i= 1 to image width(50)
for a= 1 to image height(50)
col=point(i,a)
if col<600000 then dot i,a,rgb(0,0,0) `600000 will be enough to get rid of black color
next a
next i
unlock pixels
endif
`getting new images.
for frame= 1 to 7
if frame=run then get image frame,5,2,image width(50),image height(50),1
next frame
sync
next t
`test Object
make object box 1,30,30,30
texture object 1,1
set object transparency 1,2
set object light 1,0
`test Sprite
sprite 1,200,300,2
autocam off
sync on
position camera 10,50,-100
point camera -20,0,0
img=2
DO
`Image aimation
tm=tm+1
speed=50 `the less the more...
if tm=speed then tm=1: img=img+1
if img=8 then img=2
texture object 1,img
if spacekey() then sprite 1,200,300,img else sprite 1,200,300,2
g#=g#+0.1
yrotate object 1,g#
set cursor 0,0:print "Press Space to animate sprite "
sync
LOOP
I tested also with .avi files, and it works.
Example attached.
Cheers.
I'm not a grumpy grandpa
