beetlebug▾
/

GIF

src/base/gif.zig reads and writes GIF files from the specification "Graphics Interchange Format, Version 89a" (CompuServe, 1990): the header and the logical screen, the global and the local color tables, the graphic control extension and its transparent index, the image descriptor, and the variable-length LZW codes with the clear and end codes in sub-blocks of up to 255 bytes. The code is ztk's own.

The encoder writes one image with a global table and blocks of 254 bytes. The choices that the specification leaves open (the color of the clear index, #d9d9d9; the order of the table; when the file is GIF87a; the size of a block) come from the bytes that photo data -format gif gives in runs of wish 8.6, with no read of the source of Tk.