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
 Introducing the ImageEn Color Frequency Analysis Demo Application
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

880 Posts

Posted - Jun 05 2024 :  14:07:37  Show Profile  Reply
I have now published the ImageEn Color Frequency Analysis Demo Application on my Blog:

https://pa-soft-blog.blogspot.com/2024/06/imageen-color-frequency-analysis-demo-application.html

This demo application uses an improved algorithm to extract the n most frequent colors in an image. This powerful tool is designed to analyze the most frequent colors in an image and allows users to manipulate these colors in various ways. Whether you're a developer looking to integrate color analysis into your own applications or just someone interested in exploring the color properties of images, this application provides a robust platform to meet your needs.

You can download the source code for this Demo Application, including a compiled and signed executable.
All this is completely free, so please support me as I am in an extremely difficult situation right now, so I can continue to provide more advanced source code for you:
https://pa-soft-blog.blogspot.com/p/please-support-this-blog.html
https://www.paypal.com/donate/?hosted_button_id=SL4VM4UNMVZM4

xequte

38319 Posts

Posted - Jun 05 2024 :  19:04:24  Show Profile  Reply
Nice one, Peter

Does your GetMostFrequentColors() method return the same results as GetDominantColor()?

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


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

880 Posts

Posted - Jun 06 2024 :  07:11:33  Show Profile  Reply
Hi Nigel,

Thank you for asking me. GetDominantColor is about ten times faster and the results seem to be the same! I will update the Blog article.

I use this overload:
function GetDominantColor(var DominantColors: array of TColor; Count: Integer): Integer; overload;

However, with this overload returning var DominantColors: array of TColor; from my requirements I need to exclude colors that are DARKER or LIGHTER than a specific value:

function GetDominantColor(
  var DominantColors: array of TColor; 
  Count: Integer;
  // luminance or lightness (Byte or Double):
  ExcludeColorsDarkerThan: Byte;
  ExcludeColorsLighterThan: Byte
  ): Integer; overload;


Can you implement this overload? Many users will find it very helpful!

Reason: Imagine you analyze this image:



With the current overload I get this huge number of dominant dark colors:



This is the reason I need to exclude dark colors.
Go to Top of Page

xequte

38319 Posts

Posted - Jun 06 2024 :  21:52:05  Show Profile  Reply
Hi Peter

I have added ExcludeLighterThan/ExcludeDarkerThan in the latest beta. You can email me for it.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

880 Posts

Posted - Jun 07 2024 :  03:16:16  Show Profile  Reply
Hi Nigel

Thank you for your fantastic support!
Go to Top of Page

PeterPanino

880 Posts

Posted - Jun 09 2024 :  16:51:15  Show Profile  Reply
Hi Nigel,

in the new GetDominantColor function, the ExcludeLighterThan and ExcludeDarkerThan calculations use a simple mean value of R, G, and B, which leads to undesired results.

Please see my Blog article about LUMINANCE VS. LIGHTNESS and their calculation formulas:

https://pa-soft-blog.blogspot.com/2024/06/luminance-vs-lightness.html

Please use these better calculations to process ExcludeLighterThan and ExcludeDarkerThan calculations instead. You could determine in the ImageEn Global Options if ExcludeLighterThan and ExcludeDarkerThan use the LUMINANCE or the LIGHTNESS calculation method (they are declared as Double type).

Thank you for your support!

Go to Top of Page

xequte

38319 Posts

Posted - Jun 09 2024 :  23:52:50  Show Profile  Reply
OK, we have changed it to use the HSL lightness value.

If you would prefer the YCbCr luminance value instead, then use IEGetDominantColor() directly.

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