PixelArtProcessor

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

Up and coming

Turn animation frames into small pixel-art sprites with one shared palette, outlines and steady colours.

Add frames one by one or a whole folder. ProcessAsync crops them to shared bounds, fits them in MaxSize, quantises to one palette solved once for every frame, pads, outlines and holds colours that flicker for a frame or two; SaveSheetAsync writes the sprite sheet. The settings live in Properties, so you can tune ColorCount or MaxSize and run it again.

Made with Instance.new("PixelArtProcessor") or Clone().

Properties

NameTypeDefaultDescription
ColorCountnumber12 by default; the palette is solved once with k-means and used for every frame.
Palette{ Color3 }?Set it to force a palette instead of solving one.
DitherbooleanTrue by default: a colour between two palette colours alternates in a fixed pattern instead of banding.
MaxSizenumber64 by default: the longest side of a frame, outline and padding included.
Strokenumber1 by default: the outline's thickness in pixels.
OutlineColorColor3
SteadyColorsbooleanTrue by default: a pixel that changes colour for only a frame or two is held, which removes flicker.

Methods

NameArgumentsReturnsDescription
AddFrameAsync
yields
(image: GpuTexture | string)(boolean, string?)
AddFolderAsync
yields
(folder: string | PathHandler)(number?, string?)Adds every frame in a folder, in name order, and returns how many.
GetPaletteAsync
yields
()({ Color3 }?, string?)
ProcessAsync
yields
()({ GpuTexture }?, string?)Crops every frame to their shared bounds, then fits, quantises, pads, outlines and steadies them, and returns the sprites.
SaveSheetAsync
yields
(path: string | PathHandler, layout: Vector2)(boolean, string?)Writes the sprite sheet to a file and waits until it is written.

Events

NamePassesDescription
FrameDone(number, number)Fires for each finished frame, passing its index and the total.
From ShotInstance 33