sprite ai
Test a second-row sprite edit before writing a native cel buffer
An AI-assisted recolor can keep a cropped cel’s total byte count unchanged and still overwrite the wrong pixel. The row pitch describes the distance between successive rows in the native image. A caller that guesses a convenient pixel layout from the finished PNG can walk the wrong distance between those rows.
Put different sentinels on both rows
Use an illustrative 3 × 2 cropped RGBA cel. Give the last pixel of the first row and the first two pixels of the second row distinct colors. Read the native image and use its reported stride and height to check the buffer length before writing. Recolor the second row’s first pixel and confirm the two adjacent sentinels are intact after a fresh export. Include a negative control that treats the row as if it were the full sprite’s width. The validator should prevent that write from reaching the cel.
The technical guide and test fixture measures the native stride and 16-byte buffer of a separate 2 × 2 RGBA cel in LibreSprite 1.3. If your job supports indexed or grayscale cels, validate their mode and byte layout independently with new sentinels before reusing the RGBA editing procedure.
Prepared by the FrameSprite Workflow Team with AI assistance. Examples are illustrative unless attributed to a linked fixture.