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

Offline Piotr

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

Re: What is best 256 color palette?

Reply #60 on: January 08, 2017, 03:53:33 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.
NES palette contained extremely saturated colors, but it didn't contain the right hues for red/yellow/green/cyan/blue/magenta. This is the problem I was talking about. You don't care about extremely saturated colors, but I care: Include all 8 basic colors to cover the corners of RGB cube.

Offline Piotr

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

Re: What is best 256 color palette?

Reply #61 on: January 08, 2017, 04:43:19 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.
Also the saving format in any picture is binary. So there is no clear way of storing 10-color picture while taking less space than 16-color one. You need things like storing 3 pixels in 10 bits. Here are the sizes of raw pictures the size of 320*200 with various palette storage systems (excluding size and indexed color info, KB is 1000 B, KiB is 1024 B):
2 color:
8 KB, 7.8125 KiB
3 color (5 pixels in 8 bits):
12.8 KB, 12.5 KiB
4 color:
16 KB, 15.625 KiB
5 color (3 pixels in 7 bits):
18.66725 KB, 18.229736328125 KiB (64000 pixels are not divisible by 3, so it's a bit more than 18.66666... KB)
6 color (5 pixels in 13 bits):
20.8 KB, 20.3125 KiB
8 color:
24 KB, 23.4375 KiB
However for older machines/video cards like ZX Spectrum, GameBoy or CGA, tricks like storing 5 pixels in a byte for 3 colors are either slow (using mod operations) or consume system memory (if you define what each byte means, for example 7F byte may be defined as black, yellow, yellow, cyan, black). That's why it's better to use powers of 2 for number of colors in storage. Go to newer machines/video cards and you'll find out that you have 16777216 colors already. 320x200, 640x200 (with tall 1x2 pixels that can resemble 640x400 by using stretched 8x8 fonts in place of 8x16), 640x400, 1280x800, ... are the resolutions that provide maximum size with binary video memory sizes and palettes with 2^(2^n) colors (2, 4, 16, 256, 65536, 4294967296, ...) while 320x256, 640x256, 640x512, 1280x1024, ... merit palettes with 2^(3*(2^n)) colors instead (8, 64, 4096, 16777216, ...). 640x480 and 1024x768 don't have this property.

Offline Piotr

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

Re: What is best 256 color palette?

Reply #62 on: January 10, 2017, 05:14:22 pm
If I interpret your question correctly, you want to know which 256 colors to pick to a palette to make things look good. This is called the black magic art of color reduction. There's plenty of ways to perform it, some work better than others, and all of them are wrong, as what you're doing is removing information. One common way is to place all desired colors into an octree and then reading out the 256 biggest cells; another is to do median-cut of the color space until you have 256 segments.
But how can I get an image to reduce colors? Making art with no palette or color restrictions is harder than making art and picking the colors of art from the best 256 color palette or 16 or 4 or 2.

On topic: I'm pretty sure this is best palette:

Organized version:

Though the ramps in the first one look like 10 colors, they can be combined with 6 color ramps in websafes to create 16. A ramp from none to full of n values actually has fractions of n-1, so the full 16-color ramps (0/15 to 15/15) contain 6-color websafe ramps (0/5 to 5/5) and so does the full 4096 color palette (16x16x16) I decided to base this palette on instead of 512 (8x8x8) color palette.
« Last Edit: January 11, 2017, 07:10:55 am by Piotr »

Offline yrizoud

  • 0010
  • *
  • Posts: 330
  • Karma: +0/-0
    • View Profile

Re: What is best 256 color palette?

Reply #63 on: January 12, 2017, 02:01:26 pm
I don't think you'll convince anyone. This palette is ultra-saturated, how can you pick colors for skin tones or hair when drawing a character's portrait, what about natural shades to draw scenery : ground, trees, foliage, stone, sky,...?
I really think you should look at any of the threads from other people who design palettes, they explain their choices and get feedback from others. This will help you understand what people consider useful in a palette :
Arne 16 : http://pixelation.org/index.php?topic=4306.0
DawnBringer's DB16 : http://pixeljoint.com/forum/forum_posts.asp?TID=12795
DawnBringer's DB32 : http://pixeljoint.com/forum/forum_posts.asp?TID=12795
Lendrick's 32 color "Bright Fantasy" : http://pixeljoint.com/forum/forum_posts.asp?TID=18845

Edit : Here is an extrapolation of DB16 and Arne16 to 256 colors, by simply adding 2 new colors between all pairs of colors in the original (the resulting 240 colors are then sorted by hue).

___
If you try to reduce any arbitrary image to any of those palettes, it's very likely that the result preserves many different shades, while the websafe palette would provide very few useful colors.

(Lua script to expand a 16-color palette in Grafx2) :
Code: [Select]
target=16
for y = 0, 15, 1 do
  for x = y+1, 15, 1 do
    r1, g1, b1 = getcolor(y)
    r2, g2, b2 = getcolor(x)
   
    setcolor(target, (r1 * 2 + r2)/3, (g1 * 2 + g2)/3, (b1 * 2 + b2)/3)
    target = target+1
    setcolor(target, (r1 + r2 * 2)/3, (g1 + g2 * 2)/3, (b1 + b2 * 2)/3)
    target = target+1
  end
end

 
« Last Edit: January 12, 2017, 04:04:11 pm by yrizoud »

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 #64 on: January 13, 2017, 01:23:10 am
I would rather say that Piotr is trying to solve a problem that is so abstracted it doesn't exactly exist. Arriving at a good palette (or ellipse) is beside the point and so advice about what is useful is irrelevant -- the real problem is the idea that these problems can be resolved in an "ideal" way (rather than experimentally felt out for a given image/context)
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 #65 on: January 14, 2017, 07:49:10 am
I would rather say that Piotr is trying to solve a problem that is so abstracted it doesn't exactly exist. Arriving at a good palette (or ellipse) is beside the point and so advice about what is useful is irrelevant -- the real problem is the idea that these problems can be resolved in an "ideal" way (rather than experimentally felt out for a given image/context)
I repeated this a lot of times. I DON'T want good ellipses. Paint.net gives them. I want to see which ellipses different people prefer.

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 #66 on: January 14, 2017, 12:28:18 pm
My mistake. In that case, I have to ask, what do you aim to learn from these topics? They are both contextual questions -- a good palette and a good ellipse exist only in relation to an effect you hope to achieve.

A person does not, IME, set out to make 'a 3x5 ellipse', but rather, sees that an ellipse may be suitable here, throws an arbitrary ellipse down, and adjusts it until it suits the context. Factors such as how bright the ellipse should be, what level of contrast it should have with the background, whether it needs to be animated, and whether it is part of a tile all enter into exactly what shape is used, as well as more difficult to pin down concerns as it's contribution to the overall likeness of the subject / conformity to the particular style of the game, site, or project it is supposed to be a part of.
Similar considerations apply to palettes, and, I think it is reasonable to say, 99% of all art-related work. Examining WIP animations can demonstrate this process.

What I am trying to say is that, when you insist that the context, which is the only thing that makes a given choice meaningful, is excluded from replies, there is, AFAICS, nothing at all that anybody can say about the topic (if abiding by the terms you specify).
« Last Edit: January 14, 2017, 12:47:28 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 #67 on: January 14, 2017, 06:44:36 pm
I don't think you'll convince anyone. This palette is ultra-saturated, how can you pick colors for skin tones or hair when drawing a character's portrait, what about natural shades to draw scenery : ground, trees, foliage, stone, sky,...?
Doing art is very restricting way to test palettes. A best palette has to be universal for: art, text console, emulating, UI, ... . With 8 simple colors, , you can have any color by dithering, and using websafes can make the colors for dithering closer to wanted color, and it's better for fine shading tasks like anti-aliasing. It would be pretty stupid to have a palette without , since I need them to have a best palette. My 256 color palette is a subset of 4096 color but in a different way that allows exactly and includes websafe palette. The remaining 40 colors make ramps for anti-aliasing. Just because you noticed problems for art doesn't mean it's a bad palette. A best palette has to be universal for: art, text console, emulating, UI, ... . So the websafe palette does the job for all tasks, and 40 color ramp fill fixes the weak point in grayscale and text. Also it's easy to pick colors. Pick the color from non-restricted color selector (you can pick from 4096 colors too), then convert to websafe. That's it. While extrapolated Arne and stuff would be horrible if you want these extra saturated colors. My palette does the perfect job if you want these saturated colors. Repeated:
256 colors image:

Organized to show 16-color ramps:

Try to show perfect yellow text on black background. In my palette, it's easy: use FFFF00 as text (last in yellow ramp) and use 000000 as background (first color)

Offline yrizoud

  • 0010
  • *
  • Posts: 330
  • Karma: +0/-0
    • View Profile

Re: What is best 256 color palette?

Reply #68 on: January 26, 2017, 12:30:39 pm
(edit: in reply to the deleted post "Bump this thread")
What about we bury it instead. It's been nearly 17 months and you're still ignoring or rejecting other people's answers.
« Last Edit: January 27, 2017, 01:45:34 pm by yrizoud »

Offline Piotr

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

Re: What is best 256 color palette?

Reply #69 on: January 27, 2017, 09:04:45 am
What about we bury it instead. It's been nearly 17 months and you're still ignoring or rejecting other people's answers.
That's because they are bad.