antimatter15 / jsgif

Save a HTML5 Canvas to GIF and Animations. A port of as3gif GIFPlayer to JS
http://antimatter15.com/
MIT License
1.07k stars 138 forks source link

optimized memory usage by maintaining encoded GIF data in a Uint8Arra… #40

Open joshi1983 opened 1 year ago

joshi1983 commented 1 year ago

Optimized memory usage by using Uint8Array instead of a classical untyped Array

Since a Uint8Array uses only 1 byte per element and every number is likely a 64-bit floating point number, Uint8Array should be a much more compact way to store the data. This change was tested by running encoding the same frames of a long gif animation that previously crashed the browser every time on the same laptop, same browser, same version of Windows...

This helps with issue #37