How the GIF is built
Each image is drawn onto a canvas of the chosen size, centred on white. The frame’s colours are reduced to its own best 256-colour palette and written to the GIF with the delay you chose. The MIT-licensed gifenc library does the encoding in your browser.