Encode tone indices with their palette as a palette-indexed PNG, at the smallest bit depth that fits (1 bit for 2 colours, 2 for 4, 4 for 16).
Encode tone indices with their palette as a palette-indexed PNG, at the smallest bit depth that fits (1 bit for 2 colours, 2 for 4, 4 for 16).