AsyncGifEncoder
Parameters
The Sink to write the GIF data to.
The tolerance for color difference used by colorSimilarityChecker when performing transparency optimization. This optimization works by making pixels that are similar to the pixel in the previous frame transparent, resulting in only pixels that are different being saved. Higher values will result in a smaller file size at the cost of visual artifacts. This optimization is most effective on animations with large static areas.
The default value of 0 slightly reduces file size with no visual quality loss.
A value of around 0.01 provides a good tradeoff between file size and quality.
Set to -1 to disable transparency optimization.
The tolerance for color difference used by colorSimilarityChecker when performing transparency optimization after quantization. This optimization works by making pixels that are similar to the pixel in the previous frame transparent, resulting in only pixels that are different being saved. Higher values will result in a smaller file size at the cost of visual artifacts. This optimization is most effective on animations with large static areas.
A value of around 0.02 provides a good tradeoff between file size and quality.
Set to -1 to disable transparency optimization.
The number of times the GIF should loop.
Set to 0 for infinite looping.
Set to -1 for no looping.
The maximum number of colors in each frame.
Must be between 1 and 256 inclusive.
The ColorQuantizer to use for reducing the number of colors in each frame to maxColors.
The ColorSimilarityChecker to use for determining if two frames are similar enough to merge.
An optional comment to include in the GIF comment block metadata.
The alpha threshold for a pixel to be considered transparent. Pixels with an alpha value equal to or less than this value will be treated as fully transparent.
Must be between 0 and 255 inclusive.
The solid RGB color to use for filling in pixels with partial alpha transparency, as GIFs do not support partial transparency.
Set to -1 to disable filling.
Whether to crop the transparent pixels from the edges of each frame. This can reduce the size of the GIF by a small amount.
The minimum duration for each frame in centiseconds. Setting this to a value less than 2 can result in the GIF being played slower than expected on some GIF viewers.
Must be positive.
The maximum number of frames that can be processed concurrently at the same time.
The CoroutineScope in which the concurrent encoding operations will run.