Skip to content

BuilderOption Colour Reduction

Moon edited this page May 16, 2021 · 1 revision

When setting the maximum number of colours, a colour quantizer reduces the number of colours of all images to that value.

This is a lossy transformation.

Examples:

ApngBuilder builder = new ApngBuilder();
builder.setMaximumNumberOfColours(255);
new ApngBuilder().setMaximumNumberOfColours(255).buildPng(some-filearray, 500).savePng(new File("the-APNG-filepath"));

When setting to 255, the encoder will also change the image format from truecolour to a 256 colour palette image.

Clone this wiki locally