[squeak-dev] [Discussion] GIF and Animated GIF Refactoring

Eric Gade eric.gade at gmail.com
Thu Dec 9 20:52:59 UTC 2021

Hi all,

I'm attaching an updated changeset that should by itself have everything
you need. It includes a couple of changes that should help with performance:
1) The use of ByteArrays instead of generic OrderedCollections or Arrays
where we are definitively dealing with byte values;
2) Removal of unnecessary buffering of data blocks. The GIF standard --
which is from 1989 -- described data blocks that are max 255 bytes large. I
had been taking the standard as literally as possible, so was essentially
refreshing the buffer every 255 bytes. With this changeset we are now
buffering all data bytes ahead of time into one single ByteArray, which
shouldn't be an issue for each image frame.

I have noticed a GIF reading speed improvement of >50% due to these
changes. However, larger GIFs can still take quite a bit of time.

Additionally, I have removed and/or deprecated methods that are no longer
being used.

Does anyone have additional thoughts about the tests and how Color black
does not equal the pixel value of a Form that was filled in with Color
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211209/1b6752fd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Animated-GIF-Updates.3.cs
Type: text/x-csharp
Size: 59484 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211209/1b6752fd/attachment-0001.bin>

More information about the Squeak-dev mailing list