Then I found apparently it doesn't seem to do any attempt at frame size optimisation, which isn't ideal when outputting lots of similar frames..
So I wrote a class based on top of it for writing GIFs from FB. It can save frames directly from the Screen, and will only output changed regions on each frame.
GitHub gist: https://gist.github.com/countingpine/0f ... 33d4dbfd7f (I may convert it to a full project if I decide there is potential for significant improvement.)
Code: Select all
#include "gifwriter.bi"
'' compile with fbc example1.bas gifwriter.bas
screen 13
dim s as string = !"Hello\nWorld!"
dim g as GifWriter = GifWriter("hello.gif")
for i as integer = 1 to len(s)
print mid(s, i, 1);
g.saveScreen()
sleep 100
next i
sleep
GIF image frames must all apparently either use the global palette provided at the start, or use a custom palette provided with the frame. Is far as I can gather, custom palettes can't be reused even for consecutive frames, so it's usually worth me reusing the global palette where possible, unless possibly I could reduce the bit depth by using a smaller local one. (I don't explore that.)
Also, changed regions are rectangular - no transparent pixels. Making a palette entry transparent could allow less rectangular changed regions, but would come with a lot of headaches.