#### Archived

This topic is now archived and is closed to further replies.

# Palette generation

This topic is 5551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok guys here it goes... i have given RGB data which i want to palettize.The number of palette entries is 256.Does anyone have any idea how to palettizing is performed.Just a quick algorithm or something.10x! "Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR

##### Share on other sites
An easy way is this:

run a quick frequency-analysis of the RGB data;
and select the 256 most used colors.

There is a downfall to this method though: suppose
the 2 most used colors are RGB(255, 0, 0) and RGB(254, 0 , 0)
this would mean that both this colors will be used for your
pallete...but there''s very little difference between them.

So an optimisation might be:

[PSEUDOCODE]

1. make frequency analysis

2. get most used color in list
3. compare with colors allready in list
4. if difference with all colors is high enough
put this color in the list as well and goto 2, else goto 2

[/PSUEDOCODE]

But I believe the best method is described in several articles
all over the web; using neural networks. I''m sorry I can''t explain that..because I know about uuh..NOTHING on neural networks.

##### Share on other sites
10x pal you''re method works with few modifications.I run through the data fill a 256 entries list than i run through the data again comparing the other colors.If there is a difference hight enough replace color.Else continue.10x a lot!

"Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 10
• 16
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632928
• Total Posts
3009275
• ### Who's Online (See full list)

There are no registered users currently online

×