Is there any way to divide rgb color palette?

Actually I have found a way depends on this "dividing color palette" problem. I will use this color values with converting rgb values to hsv values.

Actually I have found a way depends on this "dividing color palette" problem. I will use this color values with converting rgb values to hsv values. Hue, saturation, value so I can use one integer value between 0-360 or I can use one integer between 0-100 (%) for my color palette.

Finally, I can easily use this values for searhing/filtering my data based on color selection. I'm diving 0-360 range to 16 pices equally, so I can easily define 16 different colors. But thanks for different approaches.

1 self answers are good for StackOverflow – msw Sep 5 '10 at 2:31 but, as supercat suggested, you'll probably want to combine hue and value differences as either alone yield hard to distinguish items in 24-bit color. – msw Sep 5 '10 at 2:35.

You can approach this as a purely mathematical equipartition problem, but then it isn't really about color. If you are trying to equipartition a color palette in a way that is meaningful to human perception, there are a large number of non-linearities that need to be taken into account which this article only mentions. For example, the colors #fffffe, #fffeff, and #feffff occupy far corners of the mathematical space, but are nearly indistinguishable to the human eye.

The three colors you give as an example are clustered about the origin ;) point taken though. – aaronasterling Sep 4 '10 at 23:55 you're just numbering your axes backwards ;) point taken though. – msw Sep 5 '10 at 2:26.

You are basically projecting a cube (R X G X B) onto a square (4 X 4). First, I would start by asking myself what size cube fits inside that square. 1 X 1 X 1 = 1 2 X 2 X 2 = 8 3 X 3 X 3 = 27 The largest cube that fits in the square has 8 colors.At that point, I would note how conveniently 8 is an integral factor of 16.

I think the convenience would tempt me to use 8 basic colors in 2 variants like light and dark or saturated and unsaturated.

1 That's cheating ;) – aaronasterling Sep 4 '10 at 22:50 never mind. Evenly distributing 8 elements is just as hard as 16. – aaronasterling Sep 4 '10 at 22:54.

A lot depends on what the colors are for. I you just want 16 somewhat arbitrary colors, I would suggest: black darkgray lightgray white darkred darkgreen darkblue darkyellow medred medgreen medblue medyellow lightred lightgreen lightblue lightyellow I used that color set for a somewhat cartoonish-colored game (VGA) and found it worked pretty well. I think I sequenced the colors a little differently, but the sequence above would seem logical if arranged in a 4x4 square.

When the number of selected colors (16) is so small (especially compared to the number of available colors), you'll much better off hand-picking the good-looking palette or using a standard one (like some pre-defined system or Web palette for 16 color systems) instead of trying to invent a mathematical algorithm for selecting the palette.

1 +1 I think this is the best solution. I've got the equipartition thing going on and it's ugly. Just handpick them.

– aaronasterling Sep 5 '10 at 0:18 yes I prefer to do that but actually i'm going to integrate this palette into a search logic, so I will choose a mathamatichal way – Mehmet Fatih Yıldız Sep 5 '10 at 1:03.

This is a standard problem and known as color quantization. There are a couple of algorithms for this: Objective: You basically want to make 16 clusters of your pixel in a 3 dimension space where the 3 axes varies from 0 to 255. Methods are: 1) rounding of first significant bits.

-- very easy to implement but does not give good result. 2) histogram method. - take median effort and give better result 3) quad tree.

- state of the art data structure. Give best result but implementing the qaud tree data structure is hard. There might be some more algorithms.

But I have used these 3.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions