Аналіз піксельних кадрів і спрайтовий аркуш
Розбирає піксельні кадри, де кожен кадр — блок рядків, а кадри розділені рядком із трьома дефісами; символи сітки описані палітрою «символ = #RRGGBB». Перевіряє однаковий розмір усіх кадрів, рахує непорожні пікселі, обмежувальну рамку й використані кольори, порівнює сусідні кадри за кількістю змінених пікселів, обчислює тривалість за кадрами й частотою, будує макет спрайтового аркуша зі стелею кореня квадратного для колонок і віддає аркуш як PPM P3 із масштабом, а також ASCII-прев’ю кожного кадру.
Parses pixel frames where each frame is a block of rows and frames are separated by a line of three dashes; grid symbols are described by a palette of “symbol = #RRGGBB”. It checks that every frame has the same size, counts non-empty pixels, the bounding box and the colours used, compares neighbouring frames by the number of changed pixels, computes the duration from the frame count and rate, builds a sprite-sheet layout with the square root ceiling for columns and returns the sheet as a scaled PPM P3 together with an ASCII preview of every frame.