What are the ChangePixelFormat dithering modes?

I know that the ChangePixelFormat command is listed as undocumented, so I was hoping to find some help with regards to the available dithering mode options as in app.command.ChangePixelFormat{ format="indexed", dithering="none" } . Basically, what else can { dithering="???"} be set to?

Any help is appreciated - thank you!

welcome, sudo_whoami!
so, i looked into the source file here: aseprite/cmd_change_pixel_format.cpp at master · aseprite/aseprite · GitHub
and i see there are these options for dithering parameter:
ordered, old, error-diffusion, none

i made few tests and here’s what i’ve found:

  • error-diffusion refers to floyd-steinberg error diffusion dithering at amount 100, to change that add amount parameter:
    app.command.ChangePixelFormat{ format="indexed", dithering="error-diffusion", amount=50 }

    edit: amount of dithering is kept at value last used when changing mode manually, amount param doesn’t do anything. so for now i don’t know how to change that value
  • ordered and old will look for matrix name. if none is provided, default value is bayer matrix 8x8. to get the matrix file add dithering-matrix param:
    app.command.ChangePixelFormat{ format="indexed", dithering="ordered",["dithering-matrix"]="horiz1x3" }
    it took me a while to realize that lua doesn’t like hyphenated variable names. anyway, the name of matrix is the id of the matrix in package.json file in folder with dithering matrices. in my case it is c:\Users\ —user— \AppData\Roaming\Aseprite\extensions\dithering-matrices-lines-extended\
    if the file is not found, aseprite throws errors file not found and invalid matrix name
2 Likes

while i’m at it, here’s the rest:
format options: rgb, grayscale or gray, indexed
gray/grayscale can have additional parameter toGray with following values: luma, hsv, hsl
if you don’t provide any parameters and just call app.command.ChangePixelFormat() it will open the window with change color mode settings

1 Like

Thank you for the thorough reply! This is exactly what I’m after. Much obliged.

1 Like