I just need to resize a bunch of prerendered sprites, and set them to use a palette I’ve picked out for them. Setting the color mode to CIELAB Indexed seems to work all right for my purposes (as opposed to the others, which turn the sprite various neon shades-- no clue what’s happening there), but I need to know how to do that for a lot of sprites at once.
The docs for Aseprite’s command line interface (CLI) are here:
The docs for the scripting API are here:
Specifically, app.fs has methods for listing files in a directory, checking their file extension and so on. Sprites can be loaded from a file name, as can Palettes. Sprites can set a palette and be resized.
As far as commands, I’d take a look at ChangePixelFormat. (There is also a SpriteSize command if you prefer.)
The fitCriteria
parameter has been added to the ChangePixelFormat
, but only recently. I don’t think it’s been incorporated into a release.
If you want, check your config file from Edit > Preferences
in the General
section. It should retain your preference for LAB as the default. It is encoded as 4
.
If it really needs to be set through script, I’d try app.preferences.