AuthorTopic: What is best 256 color palette?  (Read 42638 times)

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: What is best 256 color palette?

Reply #50 on: October 05, 2015, 12:06:16 pm
Then concerns like "it's recommended that palette size is a power of two." are completely irrelevant.

If you would like to expand CPC palette out to 32 colors, why not? You seem to like that idea.

But there is no compelling performance reason to do so. Most existing quantization routines* support any size of palette, not just powers of two; and, because of this, using palette sizes that are powers of two does not improve the speed at all. This is because the code was not written using that optimization.

* for example, the ones in ImageMagick, GIMP, and GMIC.

If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline ptoing

  • 0101
  • ****
  • Posts: 3063
  • Karma: +0/-0
  • variegated quadrangle arranger
    • the_ptoing
    • http://pixeljoint.com/p/2191.htm
    • View Profile
    • Perpetually inactive website

Re: What is best 256 color palette?

Reply #51 on: October 05, 2015, 12:17:54 pm
Fairly sure you will like this little thing member Surt has made
http://img.uninhabitant.com/colourcube.html
There are no ugly colours, only ugly combinations of colours.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: What is best 256 color palette?

Reply #52 on: October 05, 2015, 01:12:54 pm
That reminds me of an idea I had after seeing that 'Palette256' link:


Sort of combining the ideas of that Palette256 and the EGA64 palette, this is a 4-5-3 color'box' (not cube since it hasn't got equal plane lengths) plus 4 grey shades, totalling 64 colors.

It seems to have better flesh tones than EGA64 (which isn't saying too much, admittedly) and a slightly reduced incidence of 'colors that seem very similar when you put them side by side'; and of course it has better green resolution and more greys.

'Palette256' also reminded me that there are other geometrical shapes to base a palette on than just box-shaped or cube-shaped volumes. A cone, or two cones back to back, is one option (suitable for colorspaces where one axis is polar, like HCY, HSL, or LCH). The main difficulty with these is, it's harder to predict their total size.
« Last Edit: October 05, 2015, 01:26:16 pm by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline Piotr

  • 0001
  • *
  • Posts: 71
  • Karma: +0/-1
    • View Profile
    • google.pl

Re: What is best 256 color palette?

Reply #53 on: October 06, 2015, 06:18:42 am
Then concerns like "it's recommended that palette size is a power of two." are completely irrelevant.

If you would like to expand CPC palette out to 32 colors, why not? You seem to like that idea.

But there is no compelling performance reason to do so. Most existing quantization routines* support any size of palette, not just powers of two; and, because of this, using palette sizes that are powers of two does not improve the speed at all. This is because the code was not written using that optimization.

* for example, the ones in ImageMagick, GIMP, and GMIC.
I am going to keep all 24-bit color in arts, and not quantizing them. These concerns become relevant if you think of older machines like CGA or ZX Spectrum, not the newer ones like VGA or Windows.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: What is best 256 color palette?

Reply #54 on: October 06, 2015, 09:07:32 am
Then concerns like "it's recommended that palette size is a power of two." are completely irrelevant.

If you would like to expand CPC palette out to 32 colors, why not? You seem to like that idea.

But there is no compelling performance reason to do so. Most existing quantization routines* support any size of palette, not just powers of two; and, because of this, using palette sizes that are powers of two does not improve the speed at all. This is because the code was not written using that optimization.

* for example, the ones in ImageMagick, GIMP, and GMIC.
I am going to keep all 24-bit color in arts, and not quantizing them. These concerns become relevant if you think of older machines like CGA or ZX Spectrum, not the newer ones like VGA or Windows.
.. Do you mean that you want to write quantization code that runs natively on retro platforms like Spectrum, using 24bit images as input? That seems strange and probably not what you meant, but I can't think of any other way to understand what you mean.

(BTW, CGA, VGA and Windows are not machines.  PC is a machine. CGA and VGA (and EGA) were video cards for PC. Windows is a family of operating system that runs on PCs)
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline Piotr

  • 0001
  • *
  • Posts: 71
  • Karma: +0/-1
    • View Profile
    • google.pl

Re: What is best 256 color palette?

Reply #55 on: October 06, 2015, 10:30:06 am
Then concerns like "it's recommended that palette size is a power of two." are completely irrelevant.

If you would like to expand CPC palette out to 32 colors, why not? You seem to like that idea.

But there is no compelling performance reason to do so. Most existing quantization routines* support any size of palette, not just powers of two; and, because of this, using palette sizes that are powers of two does not improve the speed at all. This is because the code was not written using that optimization.

* for example, the ones in ImageMagick, GIMP, and GMIC.
I am going to keep all 24-bit color in arts, and not quantizing them. These concerns become relevant if you think of older machines like CGA or ZX Spectrum, not the newer ones like VGA or Windows.
.. Do you mean that you want to write quantization code that runs natively on retro platforms like Spectrum, using 24bit images as input? That seems strange and probably not what you meant, but I can't think of any other way to understand what you mean.

(BTW, CGA, VGA and Windows are not machines.  PC is a machine. CGA and VGA (and EGA) were video cards for PC. Windows is a family of operating system that runs on PCs)
I am not going to write code at all, just a possibility to make images and save it in format compatible with ZX Spectrum, CGA and others. Quantization is only made when saving in this format. Now palettes of power of two make sense because of the format it's saved!

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: What is best 256 color palette?

Reply #56 on: October 06, 2015, 11:03:21 am
Okay, that clarifies things a little.

I have to ask though, how do you expect to use these palettes on ZX Spectrum, etc, given that most of the colors in them are not available on that display hardware?
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline Piotr

  • 0001
  • *
  • Posts: 71
  • Karma: +0/-1
    • View Profile
    • google.pl

Re: What is best 256 color palette?

Reply #57 on: October 06, 2015, 06:22:08 pm
Okay, that clarifies things a little.

I have to ask though, how do you expect to use these palettes on ZX Spectrum, etc, given that most of the colors in them are not available on that display hardware?
The images are quantized only to colors possible to display.

Offline spaceman00

  • 0001
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile

Re: What is best 256 color palette?

Reply #58 on: January 15, 2016, 04:47:54 pm
Corel Photopaint has a effect that can reduce the amount of colors of a image, actually 2 of them one called opmized and another called adjusted.

This is the pallete you get when you use adjusted effect on a image that has a single pixel to all colors, ordered by luminance, and reduce it to 256 colors


To compare this is the adjusted with 16 colors


And this is 2 colors adjusted one



The 256 colors optimized one is


The 16 optimized one is (YES I also think this is a strange as fuck pallete, considered how it was made)


The 2 colors optimized one.
« Last Edit: January 15, 2016, 04:51:35 pm by spaceman00 »

Offline Piotr

  • 0001
  • *
  • Posts: 71
  • Karma: +0/-1
    • View Profile
    • google.pl

Re: What is best 256 color palette?

Reply #59 on: February 27, 2016, 08:05:23 am
I would consider using these palettes:
4 colors:
Black Red Cyan Yellow
Black Red Green Yellow
16 colors: ZX Spectrum palette with values 0, 170, 255. In other words, RGB combinations using 0, 255 or 0, 170.
256 colors:

This one is a subset of 9-bit RGB palette of 8 values for each, with LSBs of components merged like this:
Code: [Select]
8bit 9bit (rgb)
00   000
01   011
10   100
11   110
with the only exception being brightest color, which is white. Available pure colors are black, red, cyan, yellow and white. There are 5 true grays.

Subset of 12-bit RGB palette where 2 LSBs of components are merged. 16 grays available.
65536 colors:
A palette with 4 bits of red, green, blue and alpha (16 grays).
Another one:

4 LSBs of components are merged from 24-bit RGB. 256 grays.