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

Offline Gil

  • 0100
  • ***
  • Posts: 1543
  • Karma: +1/-0
  • Too square to be hip
    • http://pixeljoint.com/p/475.htm
    • View Profile
    • My Portfolio

Re: What is best 256 color palette?

Reply #30 on: October 01, 2015, 03:24:54 pm
I think we've reached a point where no one has a clue what this thread is about?

Offline Piotr

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

Re: What is best 256 color palette?

Reply #31 on: October 01, 2015, 03:38:39 pm
I think we've reached a point where no one has a clue what this thread is about?
A good explanation:
I want a best 256 color palette, suitable for both programmers and artists. When someone suggests a method, use all suggestions together if possible, and you can use modifications to make it better. Read each method and modification carefully. Images I post without feedback are only samples, not intended to be candidates or good palettes, because I am not very good on making palettes alone.
Q: Why didn't you already do this before?
A: I didn't predict it will end up like this, for both methods (Ai) and attempt/sample images (Gil). Also I didn't know the terms "programmers" and "artists" before, but that's less important.
« Last Edit: October 01, 2015, 03:44:41 pm by Piotr »

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 #32 on: October 02, 2015, 12:28:30 am
Personally I believe that it isn't possible to generate a genuinely 'best' palette, for reasons I have stated before.

However I do believe that 'general purpose' palettes can be significantly better than the classic RGB 8:8:4 or 6:6:6 palettes. So I'm happy to provide some palettes in GPL and PNG format, which represent the closest I have gotten to a 256color palette that is generally acceptable.

(They were generated using Lch(ab) colorspace, by iterating over possible L values (0..100), checking which values of C and H are displayable sRGB colors, adding those colors to a list, and when done, artificially boosting contrast and applying 'k-means' algorithm to reduce these hundreds of thousands of colors to a set of 256. Variants were using different amounts of contrast boosting (and I also decided eventually to force the presence of a pure #ffffff white).)

If you're interested I can upload a zip file containing them.

EDIT: Link to zipfile. Contains GPL (GIMP/Inkscape/Mypaint/etc), PNG, and SOC(OpenOffice/LibreOffice) versions of each palette.

Also an Imgur gallery for quick preview
« Last Edit: October 02, 2015, 02:16:32 am 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 #33 on: October 02, 2015, 05:33:43 pm
Personally I believe that it isn't possible to generate a genuinely 'best' palette, for reasons I have stated before.

However I do believe that 'general purpose' palettes can be significantly better than the classic RGB 8:8:4 or 6:6:6 palettes. So I'm happy to provide some palettes in GPL and PNG format, which represent the closest I have gotten to a 256color palette that is generally acceptable.

(They were generated using Lch(ab) colorspace, by iterating over possible L values (0..100), checking which values of C and H are displayable sRGB colors, adding those colors to a list, and when done, artificially boosting contrast and applying 'k-means' algorithm to reduce these hundreds of thousands of colors to a set of 256. Variants were using different amounts of contrast boosting (and I also decided eventually to force the presence of a pure #ffffff white).)

If you're interested I can upload a zip file containing them.

EDIT: Link to zipfile. Contains GPL (GIMP/Inkscape/Mypaint/etc), PNG, and SOC(OpenOffice/LibreOffice) versions of each palette.

Also an Imgur gallery for quick preview
First serious help! But please force both pure white and black and reduce potential of NES palette problem (lack of good saturated red/yellow/green/cyan/blue/magenta).
For 'general purpose' keep in mind text console palettes, black/white monochrome, games, etc.
But... Have you tried your palettes? Is the palette below good enough?
This is a subset of 16-16-16 level RGB where values are from 0 to 15.
Right 1 step: add 1 to every component
Right 4 steps: add 4 to blue
Down 1 step: add 4 to green
Down 4 steps: add 4 to red

Offline Gil

  • 0100
  • ***
  • Posts: 1543
  • Karma: +1/-0
  • Too square to be hip
    • http://pixeljoint.com/p/475.htm
    • View Profile
    • My Portfolio

Re: What is best 256 color palette?

Reply #34 on: October 02, 2015, 06:08:54 pm
I don't think you need so many pinks and purples. There's no good browns in there either. I think the cyan ramp should be fine and I can probably work with the green ramp. I seem to lack saturation in the oranges.

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 #35 on: October 02, 2015, 10:01:13 pm

EDIT: Link to zipfile. Contains GPL (GIMP/Inkscape/Mypaint/etc), PNG, and SOC(OpenOffice/LibreOffice) versions of each palette.

Also an Imgur gallery for quick preview
First serious help! But please force both pure white and black and reduce potential of NES palette problem (lack of good saturated red/yellow/green/cyan/blue/magenta).
That's actually a problem inherent to both K-means and median-cut reduction methods, which the added contrast was intended to counteract.
However, if you want exact black, you can just replace the darkest color with black, same as I did with white.

I didn't really care about -extremely- saturated colors when making these, though.
Quote
For 'general purpose' keep in mind text console palettes, black/white monochrome, games, etc.
But... Have you tried your palettes?
Of course I have tried my palettes, on a wide range of stuff from pixel art to photos. That's how I can say it's the best I've seen (reasonably accurate and reasonably legible, over a wide range of content)

Quote
Is the palette below good enough?
This is a subset of 16-16-16 level RGB where values are from 0 to 15.
No, it's not good enough then, since the whole 16-16-16 RGB cube (4096 colors) is not good enough.
All RGB colorcubes that aren't huge( 64x64x64) have the same problem -- too many saturated colors, lack of good pastels. Which are exactly the problems shown in your palette.

(this is putting aside the problem that 256 colors, no matter how 'optimally chosen', can never approach the quality of a palette chosen specifically for the work in question. An optimally chosen 4096-color palette is about the minimum size of palette I could believe was generally high quality enough to use on everything)

Surt posted a colorcube exploring tool http://img.uninhabitant.com/colourcube.html a while ago in the Off-Topic Thread, which includes the kind of options you are exploring here, and many others..

I don't think you need so many pinks and purples. There's no good browns in there either. I think the cyan ramp should be fine and I can probably work with the green ramp. I seem to lack saturation in the oranges.
)
If this is addressed at my palette (of which there are several variants), I agree completely. Those are pretty much the exact problems that I found. To me, we have these two approaches: colorcube generation, and reduction of colors from a set of 'representative' colors. If we could figure out how to combine the strengths of
both, the result would probably be more suitable.

IIRC you can specify weights as an input to k-means clustering, which I think would work to emphasize whatever subset you think is important.

I also made a hand-optimized palette for the OHRRPGCE's new default, in 2008. The users abuse it just as badly as the old default ;). But anyway here it is:




Each 'row' is 15 colors, which means I needed to add 14 duplicate colors to the end to make it fit in the image; that's why it's 15x18 in size.

I don't expect Piotr would think this one is relevant to his project, since it really doesn't care about completely saturated colors at all (in fact, it minimizes them in order to maximize points where ramps can cross over.)
« Last Edit: October 02, 2015, 10:26:15 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 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 #36 on: October 02, 2015, 10:58:47 pm
What I would like to know is what is the end goal here? Are you planning to make some kinda custom "retro" console using an FPGA or something, or make a virtual console like PICO8?

If not this is all pretty pointless imo. As I stated before, if you only have 256 colours it is better to change them according to specific needs of your game/project.

Then again, this is all very esoteric with todays graphics hardware, and this is coming from someone who really enjoys restrictions.
There are no ugly colours, only ugly combinations of colours.

Offline Piotr

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

Re: What is best 256 color palette?

Reply #37 on: October 03, 2015, 06:01:22 am
What I would like to know is what is the end goal here? Are you planning to make some kinda custom "retro" console using an FPGA or something, or make a virtual console like PICO8?

If not this is all pretty pointless imo. As I stated before, if you only have 256 colours it is better to change them according to specific needs of your game/project.

Then again, this is all very esoteric with todays graphics hardware, and this is coming from someone who really enjoys restrictions.
But your suggestion takes a lot of time!

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 #38 on: October 03, 2015, 06:36:37 am
Which suggestion? Ptoing suggested "change the palette according to your project". If that takes a lot of time, then I think you need either a better palette editor or better asset management. Personally, GPick would be the tool of choice for me, to make a full 256 color palette.

There also used to exist a number of tools that will look at all your graphics and generate a good palette for them, but nowadays I think you usually can just use a sprite packer to pack all your assets into a single image, then indexize that to arrive at a good global palette. However, as Ptoing alludes to, the 256color limit really isn't that relevant any more anyway -- not needed for display, and the amount of disk space it saves is insignificant in modern terms.

Overall, I think it would be best if you would give an answer to Ptoing's question 'what is the end goal here?'. It's difficult to effectively help without knowing why you want an optimal 256 color palette.

EDIT: on the general topic of general 256color palettes, this looks interesting, and almost certainly better than the standard 6 6 6 or 8 8 4 colorcube palettes. My tests confirm it.

EDIT2: Here's a relatively-nicely-sorted version of it I made with the help of GPIck:

You can see the layout the author made on the webpage.
« Last Edit: October 03, 2015, 09:45:13 am by Ai »
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 #39 on: October 03, 2015, 09:57:02 am
Making a good palette is something you need to learn with practise. If you can not make a good palette for something specific from scratch, you wont be able to make a "best" palette. And again, "best" makes no sense in this case anyway.

But you have not answered my question as to why you want to do this yet.
There are no ugly colours, only ugly combinations of colours.