# Image processing using indexed colors profiles

**URL:** <https://zola.discourse.group/t/image-processing-using-indexed-colors-profiles/499>\
**Category:** Feature requests\
**Created:** [July 20, 2020, 1:05pm UTC](https://zola.discourse.group/t/image-processing-using-indexed-colors-profiles/499 "2020-07-20T13:05:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HugoTrentesaux](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/hugotrentesaux/32/105_2.png) [@HugoTrentesaux](https://zola.discourse.group/u/HugoTrentesaux)\
**Post date:** [July 20, 2020, 1:05pm UTC](https://zola.discourse.group/t/image-processing-using-indexed-colors-profiles/499/1 "2020-07-20T13:05:37Z")

</div>

In order to achieve light web pages, it’s good to use images with indexed color profiles AND small pixel size. The problem is that the `resize_image` function looses the color index of the original image, leading to an image heavier than the original. See this example:

![duniter-logo](https://global.discourse-cdn.com/free1/uploads/zola1/original/1X/98abcf2895447a1c12a247a593455aee3b02e5bf.png) ![ae63c8b0dfd9c51a00](https://global.discourse-cdn.com/free1/uploads/zola1/original/1X/d015d4d06ec089d018313834efca76d48f1f43b1.png) ![ae63c8b0dfd9c51a00_](https://global.discourse-cdn.com/free1/uploads/zola1/original/1X/22aa770aa81fc268ff65803dba3bf45d03876b56.png)

**Image 1** is `250x250 pixels` and weights **14.8 kB**  
**Image 2** is produced with `resize image`, is `160x160 pixels` and weights **27.4 kB**  
**Image 3** is created using GIMP’s color index applied on image 2 and is `160x160 pixels` and weights **5.1 kB**

We can see here that:

1. the resized image is **1.8x heavier** than the original despite having **2.4x less pixels**
2. we can produce a same-sized image **5.4x lighter** using indexed color profiles

@keats, a quick fix in mind?

PS: for people who do not know indexed color profiles, see [https://docs.gimp.org/en/gimp-image-convert-indexed.html](https://docs.gimp.org/en/gimp-image-convert-indexed.html)

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 20, 2020, 1:24pm UTC](https://zola.discourse.group/t/image-processing-using-indexed-colors-profiles/499/2 "2020-07-20T13:24:29Z")

</div>

Hmm we do use the `image` crate, I would need to check their docs to see if we’re doing something wrong.

---

<div class="post-metadata">

**Author:** ![HugoTrentesaux](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/hugotrentesaux/32/105_2.png) [@HugoTrentesaux](https://zola.discourse.group/u/HugoTrentesaux)\
**Post date:** [July 20, 2020, 1:34pm UTC](https://zola.discourse.group/t/image-processing-using-indexed-colors-profiles/499/3 "2020-07-20T13:34:28Z")

</div>

It seems not to be supported yet : [https://github.com/image-rs/image/issues/389](https://github.com/image-rs/image/issues/389)
