ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Read Pixel Counts For Palette Entries
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

HMArnold

USA
23 Posts

Posted - Jul 10 2023 :  12:23:20  Show Profile  Reply
Is there a way to read how many pixels exist for each color in a palette?

I'm pretty sure I'm just not using the correct search terms, but I can't find anything about it.

GetDominantColor gets the most used color, but is there a way to scan the pixels counts down the entire Palette?

A solution is a brute force scan of each pixel by row/column and adding the colors encountered, but I'm hoping there is a faster way to get the same result using the palette.

xequte

38616 Posts

Posted - Jul 10 2023 :  18:11:59  Show Profile  Reply
Hi

See the overload for GetDominantColor that allows you to get multiple colors in turn:

http://www.imageen.com/help/TImageEnProc.GetDominantColor.html

But if you are trying to do it for all or many colors, then you will get better performance by just iterating over the entire image and building your own color table.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: