[Images] Quantize
Q100073: [Images] Quantize
Quantizes images, reducing the number of individual colors used in each individual image.
Parameter | In/Out | Description | Other Info |
---|---|---|---|
File source | In | The file paths of eligible image files to process. Usually the output of the FileList parameter, from a variety of modules.The typical use case for this module would be to take JPEG files and convert them to PNG or GIF files, or to simply reduce the colors of a JPEG for artistic effect. GIF files are supported, but not animated GIFs. Transparency is not supported. |
|
Target folder | In | The destination folder for the modified image(s) once successfully processed. All files will be saved with the same file name as the original. |
|
Target file type | In | Choices: SameAsSourceFile , JPEG , PNG , GIF The file type to use when saving the new image file. Since this module reduces the number of colors, we recommend PNG since it will likely produce smaller files. |
Default: SameAsSourceFile |
Delete source files? | In | Check this option if you want the source files to be deleted after being successfully processed. | Default: False |
Number of colors | In | The total number of colors you want in the color palette, up to 256. This is commonly a power of two (2, 4, 8, 16, 32, 64, 128, 256) but doesn't have to be. (256 is the most common choice, especially if you are converting to PNG or GIF files, since every pixel can be represented as a single byte.) | Default: 256 |
Color reduction method | In | Choices: Grayscale , ColorCube , PairwiseNearestNeighbor The method to use to determine the image's new color palette. Pairwise Nearest Neighbor -- The best method for capturing as much of the original image's coloring as possible. Color Cube -- An evenly distributed set of colors from the RGB color cube. This typically results in an artistic effect with "purer", less subtle colors. Grayscale -- Breaks the image into N shades of gray, where N is the number of colors you selected. |
Default: PairwiseNearestNeighbor |
Dithering method | In | Choices: None , FloydSteinberg , JarvisJudiceNinke , Atkinson , TwoRowSierra Dithering is an additional step done to improve the overall look of the image to diffuse (spread out) the transitions between colors, as will often happen in skies or any large areas with smooth gradients. None -- No dithering. Floyd-Steinberg -- A commonly used algorithm to diffuse color transitions, it generally does a good job with most images. Jarvis/Judice/Ninke -- Coarser than Floyd-Steinberg, but sometimes has fewer visual artifacts. Atkinson -- Often produces attractive results with good detail, but very light and dark areas may appear blown out. Two-Row Sierra -- A newer method similar to Jarvis/Judice/Ninke, preserving slightly more detail. (NOTE: If you selected "Pairwise Nearest Neighbor" color reduction, all dithering methods will work the same way.) |
Default: FloydSteinberg |
Log output level | In | Choices: Minimal , Verbose The level of execution detail you want to appear in the log. |
Default: Minimal |
Processed file list | Out | The output pathnames that were generated. |
(Italics = required parameters)
Notes
The module [Images] Quantize
provides a way to take a list of one or more images, and apply a method for reducing the amount of individual colors in the overall image file.
Below you will see an example image file used as the source, and the results of the quantizing process/
256 Colors, PairwiseNearestNeighbor
The resulting output file reduced to 256 colors as a GIF
image file and is able to squeeze the photo down from the 2.6MB JPEG format above, to a 1.6MB image below.
Last Updated:
10/3/2023 1:07:12 AM