# How to apply color quantization to an image

**URL:** https://discourse.processing.org/t/how-to-apply-color-quantization-to-an-image/4849
**Category:** Coding Questions
**Created:** [October 25, 2018, 2:01am UTC](https://discourse.processing.org/t/how-to-apply-color-quantization-to-an-image/4849 "2018-10-25T02:01:44Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [October 31, 2018, 5:02pm UTC](https://discourse.processing.org/t/how-to-apply-color-quantization-to-an-image/4849/22 "2018-10-31T17:02:52Z")

</div>

Nice, @quark!

This could also be done with the ImageJ implementation of Median Cut.

- [https://imagej.nih.gov/ij/source/ij/process/MedianCut.java](https://imagej.nih.gov/ij/source/ij/process/MedianCut.java)

The nice thing about that implementation is it is based on java.awt.Image, so it takes a pixels[] array – no 2D conversion class required.

---

_[View the full topic](https://discourse.processing.org/t/how-to-apply-color-quantization-to-an-image/4849)._
