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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Read Pixel Counts For Palette Entries

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
HMArnold Posted - Jul 10 2023 : 12:23:20
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.
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 10 2023 : 18:11:59
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