What happens when GIF becomes PNG?
A GIF can contain several timed frames, looping instructions, frame disposal rules, application extensions, comments, and an indexed color palette. A standard PNG is a single still image, so it cannot retain normal GIF animation.
This converter requests frame zero through ImageDecoder when that browser API supports GIF. If explicit frame decoding is unavailable, it falls back to createImageBitmap and finally an HTML image element.
The decoded GIF frame becomes RGBA pixel data before Canvas encodes it as PNG. Transparency available in that frame is preserved, but animation timing, loop count, comments, disposal instructions, and original GIF metadata are not.
Why PNG output can be larger
GIF uses indexed palettes with up to 256 colors per frame. Decoding expands those palette entries into full pixel data. A detailed RGBA PNG can therefore be larger than its GIF source, even though only one frame is exported.