# 9-bit (or more) palettes

**URL:** <https://community.aseprite.org/t/9-bit-or-more-palettes/8990>\
**Category:** Features\
**Created:** [May 3, 2021, 9:23pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990 "2021-05-03T21:23:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Switch\_Z](https://community.aseprite.org/user_avatar/community.aseprite.org/switch_z/32/7049_2.png) [@Switch\_Z](https://community.aseprite.org/u/Switch_Z)\
**Post date:** [May 3, 2021, 9:23pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/1 "2021-05-03T21:23:04Z")

</div>

Since it’s impossible to fully index palettes with over 256 colors, it’d be a lifesaver if one wants to work with, for instance, the Sega Genesis palette, that has 512 colors.

---

<div class="post-metadata">

**Author:** ![Olga\_Galvanova](https://community.aseprite.org/user_avatar/community.aseprite.org/olga_galvanova/32/3294_2.png) [@Olga\_Galvanova](https://community.aseprite.org/u/Olga_Galvanova)\
**Post date:** [May 5, 2021, 9:08am UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/2 "2021-05-05T09:08:12Z")

</div>

hi, Switch\_Z. you can have palettes with more than 256 colours. what i do is following:

1. import palette i wish to use as gpl
2. use [FastBit](https://community.aseprite.org/t/script-fastbit-color-picker-v1-2/5687) colour picker
3. often i also have a colour chart on screen to pick colours more quickly, something like this:  
 ![](https://upload.wikimedia.org/wikipedia/commons/b/bc/RGB_15bits_palette_color_test_chart.png)

i load palette just to check if selected colour is indeed included and use WolftrooperNo86’s script for actual colour selection. if i feel like i want to pick colour more naturally, i pick it from colour chart and again check if that colour is in the palette. if it isn’t, FastBit checker can pick the closest colour for me.

since bigger palettes are very hard to navigate i believe this is the best way how to work with larger palettes we have now.

you can download gpl palettes for probably any hardware you wish (for example mega drive palette [here](https://github.com/denilsonsa/gimp-palettes/blob/master/palettes/HW-9-bit-RGB.gpl)). or optionally it is not hard to generate your own gpl palette by script (i use free program called processing for that).

---

<div class="post-metadata">

**Author:** ![Ethan\_Buttazzi](https://community.aseprite.org/user_avatar/community.aseprite.org/ethan_buttazzi/32/3265_2.png) [@Ethan\_Buttazzi](https://community.aseprite.org/u/Ethan_Buttazzi)\
**Post date:** [May 6, 2021, 6:18am UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/3 "2021-05-06T06:18:43Z")

</div>

can confirm

 ![image](https://community.aseprite.org/uploads/default/original/2X/e/ef29886e1fdf78d5538459d9d7e4e624a77fbf24.png)

---

<div class="post-metadata">

**Author:** ![dacap](https://community.aseprite.org/user_avatar/community.aseprite.org/dacap/32/10_2.png) [@dacap](https://community.aseprite.org/u/dacap)\
**Post date:** [May 8, 2021, 7:43pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/4 "2021-05-08T19:43:31Z")

</div>

Hi there @Switch_Z! I’m not sure but probably you are looking for an [Indexed mode](https://www.aseprite.org/docs/color-mode/#indexed) with 9-bit (or big as 16-bit). At the moment this is not supported, you can have a palette with more than 256 colors, but indexed mode only support 8-bit per pixel.

We thought about the possibility to handle indexed images with 16-bit per pixel, that could be an option in the future.

---

<div class="post-metadata">

**Author:** ![Switch\_Z](https://community.aseprite.org/user_avatar/community.aseprite.org/switch_z/32/7049_2.png) [@Switch\_Z](https://community.aseprite.org/u/Switch_Z)\
**Post date:** [May 8, 2021, 9:17pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/5 "2021-05-08T21:17:16Z")

</div>

@dacap This is exactly what I meant, I apologize for not phrasing it correctly. And thanks for your notice! Looking forward for that to be a reality!

---

<div class="post-metadata">

**Author:** ![Switch\_Z](https://community.aseprite.org/user_avatar/community.aseprite.org/switch_z/32/7049_2.png) [@Switch\_Z](https://community.aseprite.org/u/Switch_Z)\
**Post date:** [May 8, 2021, 9:21pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/6 "2021-05-08T21:21:33Z")

</div>

@Olga_Galvanova @Ethan_Buttazzi And thanks for taking your time to reply!

---

<div class="post-metadata">

**Author:** ![Ethan\_Buttazzi](https://community.aseprite.org/user_avatar/community.aseprite.org/ethan_buttazzi/32/3265_2.png) [@Ethan\_Buttazzi](https://community.aseprite.org/u/Ethan_Buttazzi)\
**Post date:** [May 8, 2021, 11:40pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/7 "2021-05-08T23:40:38Z")

</div>

well now i know this and i want it, also i tried it seems that even doing create palette from sprite it doest regonize i didt undestaqnd it feel like it gets the color but sligly different i dont know

---

<div class="post-metadata">

**Author:** ![Ethan\_Buttazzi](https://community.aseprite.org/user_avatar/community.aseprite.org/ethan_buttazzi/32/3265_2.png) [@Ethan\_Buttazzi](https://community.aseprite.org/u/Ethan_Buttazzi)\
**Post date:** [May 8, 2021, 11:42pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/8 "2021-05-08T23:42:06Z")

</div>

see

 ![image](https://community.aseprite.org/uploads/default/original/2X/0/0248cc5b93d67c08a2b2aea8a96415e6bd6278e0.png)  
i just picked a color from the screen and isn’t anywere on the palette it should have picked something.

edit: see this

 ![image](https://community.aseprite.org/uploads/default/original/2X/9/9fb5f644dec58a732104da336f42452295845324.png)  
now  
 ![image](https://community.aseprite.org/uploads/default/original/2X/f/fdf08c96e2494371e955a958e3096bacd69a6208.png)  
the one on the palette is just slighly different

edit two:  
after further investigation it became obvios that whatever algorith you use to pick colors from the sprite goes badomcaboncas after 256

even the palette gets wonky too that up

 ![image](https://community.aseprite.org/uploads/default/original/2X/a/ac28fad5e272f9fc524bac56c43a783c306edff2.png)  
exacly 256 colors here  
 ![image](https://community.aseprite.org/uploads/default/original/2X/1/128b9d4869a632e798a4a29859f2793ecc79add6.png)  
one more color and boom  
 ![image](https://community.aseprite.org/uploads/default/original/2X/6/6933fe3630c348a456eb1fdddf715d1fc4a352cb.png)

thats a bug that should happen  
@dacap this needs a fix as soon as possible dude like next patch

---

<div class="post-metadata">

**Author:** ![dacap](https://community.aseprite.org/user_avatar/community.aseprite.org/dacap/32/10_2.png) [@dacap](https://community.aseprite.org/u/dacap)\
**Post date:** [May 9, 2021, 2:19pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/9 "2021-05-09T14:19:18Z")

</div>

> [@Ethan\_Buttazzi](#):
>
> @dacap this needs a fix as soon as possible dude like next patch

There is a fix for v1.3 using octrees for these cases where the image has more than 256 colors, but it’s not automatic by default (or not chosen automatically). Still thinking if it should be the default mode (it doesn’t work when the image has transparencies):

 ![image](https://community.aseprite.org/uploads/default/original/2X/1/175957c93e9b550f69ba019684973e2a42b6b590.png)

Probably it should be the default mode when there is no semi-transparent colors.

---

<div class="post-metadata">

**Author:** ![BraidAcer](https://community.aseprite.org/user_avatar/community.aseprite.org/braidacer/32/7193_2.png) [@BraidAcer](https://community.aseprite.org/u/BraidAcer)\
**Post date:** [May 9, 2021, 4:54pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/10 "2021-05-09T16:54:56Z")

</div>

Why not add also method from my script for images with colors count \<= 255. Or 1.3 it will be exact in this cases?

---

<div class="post-metadata">

**Author:** ![dacap](https://community.aseprite.org/user_avatar/community.aseprite.org/dacap/32/10_2.png) [@dacap](https://community.aseprite.org/u/dacap)\
**Post date:** [May 9, 2021, 5:22pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/11 "2021-05-09T17:22:16Z")

</div>

The main issue right now for sprites with less than 256 colors is the RGB → Indexed conversion. It’s using the 5-bit RGB cube which reduce the precision for the color matching if there are similar colors in the palette.

Octrees will work as the dictionary (actually better because octrees are faster and specially made for these cases).

---

<div class="post-metadata">

**Author:** ![dacap](https://community.aseprite.org/user_avatar/community.aseprite.org/dacap/32/10_2.png) [@dacap](https://community.aseprite.org/u/dacap)\
**Post date:** [May 9, 2021, 5:27pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/12 "2021-05-09T17:27:24Z")

</div>

Just in case as a comment: Aseprite needs to handle all kind of images (sprites with few colors and big photos). So if some specific algorithm or data structure requires a lot of memory (or time) to finish to convert a big picture from RGB to indexed (e.g 4000x4000), the algorithm cannot be used because as it can easily produce a crash. Generally we need more generic solutions (instead of specific tailor-made solutions). (And just in case, there are several cases where Aseprite doesn’t handle big pictures correctly, e.g. RotSprite, we’ll be working to fix that too.)

---

<div class="post-metadata">

**Author:** ![Ethan\_Buttazzi](https://community.aseprite.org/user_avatar/community.aseprite.org/ethan_buttazzi/32/3265_2.png) [@Ethan\_Buttazzi](https://community.aseprite.org/u/Ethan_Buttazzi)\
**Post date:** [May 9, 2021, 10:08pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/13 "2021-05-09T22:08:39Z")

</div>

well why dont you do this:

measure the pros and cons in each case the one that has more would be the default  
ps: also cant you do an error catcher, and cancel a process if its will cause a crash in aseprite?

---

<div class="post-metadata">

**Author:** ![dacap](https://community.aseprite.org/user_avatar/community.aseprite.org/dacap/32/10_2.png) [@dacap](https://community.aseprite.org/u/dacap)\
**Post date:** [May 9, 2021, 10:25pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/14 "2021-05-09T22:25:50Z")

</div>

I’m just working on a way to use octree in almost all cases (I think the only case it cannot be use is when semi-transparent pixels are in the canvas or palette). But it will delay the v1.3 release.

---

<div class="post-metadata">

**Author:** ![BraidAcer](https://community.aseprite.org/user_avatar/community.aseprite.org/braidacer/32/7193_2.png) [@BraidAcer](https://community.aseprite.org/u/BraidAcer)\
**Post date:** [May 9, 2021, 11:40pm UTC](https://community.aseprite.org/t/9-bit-or-more-palettes/8990/15 "2021-05-09T23:40:52Z")

</div>

When there are limited colors it will be better to use algorithm without quantization. Fixed hashmap with good amount of buckets should be enough to handle exact colors plus semi-transparent colors. Semi-transparent colors may be important too. For example, our rendering pipeline support semi-transparent palette entries for certain sprites (with TRANSPARENT blending mode) and it will be good to handle them natively. It can be added afterwards in 1.3.xx releases.
