> For the complete documentation index, see [llms.txt](https://astropulse.gitbook.io/retro-diffusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://astropulse.gitbook.io/retro-diffusion/aseprite-extension/retro-diffusion-scripts/palettize-menu.md).

# Palettize Menu

<figure><img src="/files/9pMWo7nDnQLecK6BO3As" alt=""><figcaption><p>"Palettize" menu</p></figcaption></figure>

## Palettize

"Palettize" has several input settings, but requires at least one layer and frame for each image. It can be found in "Help" -> "Retro Diffusion Scripts" -> "Palettize," or in "Sprite" -> "Palettize."

"Palettize" requires an active sprite canvas and the RGB color mode.

It also uses "k-means" clustering to reduce the number of colors in an image.

<figure><img src="/files/JTvITQw6clFR9nyRzC21" alt=""><figcaption><p>Left: 16,980 colors | Right: 54 colors</p></figcaption></figure>

## Palette Source

<figure><img src="/files/BBIfTaNkotXcwGR6Ingb" alt=""><figcaption><p>Palette source options</p></figcaption></figure>

"Palette source" lets you pick which color palette you want applied to the selected images.

<figure><img src="/files/ZMmg1cmWywRmYs5TGlmo" alt=""><figcaption><p>Baseline color image</p></figcaption></figure>

### Automatic

The "Automatic" palette source analyzes the image and selects the best number of colors to reduce it to without losing detail.

<figure><img src="/files/umndOt7zaoAaossrGTql" alt=""><figcaption><p>New palette chosen based on least colors while retaining quality</p></figcaption></figure>

### Best Palette

The "Best Palette" palette source looks at a folder with multiple PNG palette images and decides which palette best fits the current image based on color differences.

Available palettes in example: [nice31](https://lospec.com/palette-list/31), [blk-36](https://lospec.com/palette-list/blk-36), [commadore64](https://lospec.com/palette-list/commodore64), [fantasy24](https://lospec.com/palette-list/fantasy-24), and [vinik24](https://lospec.com/palette-list/vinik24).\
Commadore64 was chosen for its better coverage of all hues.

<figure><img src="/files/rQpmWzC9eLoawqiSXlit" alt=""><figcaption><p>Commadore64 color palette</p></figcaption></figure>

### Adaptive

The "Adaptive" palette source restricts the colors to an exact number, and any new colors are derived from the original image.

<figure><img src="/files/X0Fy6hJd8PFbuP5WPnJU" alt=""><figcaption><p>Palette reduced to exactly 24 colors</p></figcaption></figure>

### Active Palette

The "Active palette" palette source uses the colors from the current sprite's palette.

### Defaults

The "Defaults" palette source provides a list of the palettes that are built into Aseprite.

### File

The "File" palette source lets you choose an image to use as a palette. It must be a PNG image.

### URL

The "URL" palette source loads the image from the url in the text box.

## Dithering

<figure><img src="/files/9a7roOT9mk3qOUaYBpes" alt=""><figcaption><p>Dithering options</p></figcaption></figure>

Dithering was a technique commonly used in older art to make better use of the then limited colors. Now, it is a common practice in pixel art used to create details, gradients, and other image features.

### Matrix Size

"Matix Size" can be set to "None" (no dithering), "Bayer 2x2," "Bayer 4x4," or "Bayer 8x8."

#### Bayer 2x2

<figure><img src="/files/K9DuMkTLnIeyY9XlwZwU" alt=""><figcaption><p>Bayer 2x2 dithering</p></figcaption></figure>

#### Bayer 4x4

<figure><img src="/files/f6WnfszIKD1ZZQa27EdH" alt=""><figcaption><p>Bayer 4x4 dithering</p></figcaption></figure>

#### Bayer 8x8

<figure><img src="/files/TaFjfNxAaIqN3XEhgJvn" alt=""><figcaption><p>Bayer 8x8 dithering</p></figcaption></figure>

### Dither Strength

<figure><img src="/files/7R6hNRAQYeAezEElZ3yB" alt=""><figcaption><p>Strength 2, 6, and 10</p></figcaption></figure>

"Dither Strength" controls how much dithering is applied to the image.

## Denoising

Denoising is an advanced feature and is only recommended for experienced users. Without experience, denoising often leads to poor results.

<figure><img src="/files/tVCu5a5E0mhxUm5c1jiL" alt=""><figcaption><p>Left: Normal palettization to 24 colors | Right: Denoised to 24 colors</p></figcaption></figure>

### Smoothness

"Smoothness" (appears when the denoise box is checked) does exactly what it says-it controls an image's smoothness. This is related to kernel size.

### Strength

The "Strength" slider controls how aggressively the denoising tries to remove stray pixels.

## Processing Cels

This applies "Palettize" to multiple images. If both options are checked, all images in the sprite will be processed.

### All layers

The "All layers" checkbox applies "Palettize" to all layers in the selected frame.

### All frames

The "All frames" checkbox applies "Palettize" to all frames on the selected layer.

## Process in Background

"Process in background" keeps the command line interface minimized.
