OptionalcolorsLossy: the maximum colors in the palette (2-256, including transparency), each with its own transparency, so soft
edges and shadows stay soft. Makes photos with transparency and graphics with gradients much smaller. Images with
no more colors keep them exactly (the file is the same as without this option); otherwise ImageScript chooses
representative colors and applies dither. Fully transparent pixels lose their hidden color. The image itself
stays unchanged
OptionalcompressionThe compression level (0-9), higher is smaller but slower
OptionalditherHow to spread small color changes across nearby pixels to make gradients look smoother with few colors, see DitherMethod
OptionalditherHow strongly to apply dithering: 0 disables it (like 'none'); 1 applies it fully
OptionalmetadataMetadata to include, see Metadata
OptionalthreadsMaximum threads for compression. Small images (under 2 MiB of pixel data) and runtimes without node:zlib (such as browsers) use one thread
Options of Image.encodePNG.
ditherandditherStrengthare only used withcolors