# Posterization

### Plugs

* Image
* Vector

### Role

Recolor an image or vector by mapping each color to the closest color listed in the `Colors` property.\
The distance can be computed in two color spaces; `RGB` or `HSL`.\
In case of equidistance between two or more colors, the first one found it the one assigned.

### Properties

* **Colors**: List of color listed either by CSS color code or color name
  * ex.: `purple, #ff0000, #abcd56, black`
* **Color Space**: `RGB` or `HSL` space

### Limitations

* An SVG with a gradient only maps the limit of the gradient and not the intermediate colors.
  * The work around for this is to create a canvas and use the vector node in a canvas composite then add the `posterization` operator.
* An embedded image in an SVG file won't be recolored.
  * The same work around using a canvas composite works in this case

**Posterization** has been added as an operator for images. Now you can recolor images in real-time to a predefined list of colors. For example, if a Customer only prints 20 set colors or in black and white, Threekit can automatically recolor image uploads to those 20 colors in the configurator. Threekit can also export the recolored images for post-order workflows.\
Head over to a Texture asset and add the Posterization Operator. Then you can add a list of colors using HEX code or HTML color names<br>

<figure><img src="/files/NOckicJ5fYTQUnNJTUBJ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://community.threekit.com/platform-documentation/project-data/operators/image-operators/posterization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
