Pages

Monday, 6 May 2024

HOW TO GET THE MOST FREQUENT COLORS IN AN IMAGE BY USING EMBARCADERO DELPHI

ImageEn is one of the best and most popular image libraries for Embarcadero Delphi.

Here, I use it in my new Screenshot Software Application:


I needed a function to extract the 16 most frequent colors from the above screenshot image:

This function returns the most frequent colors in TImageEnView in order of frequency























After having retrieved the 16 most frequent colors from the Notepad screenshot image above, I assign them to the CUSTOM COLORS of a Color Dialog:


I use this Color Dialog in my screenshot application to select a color for a FloodFill feature to edit the screenshot image.

Here, I added a colorful illustration to the screenshot image:


Please note how the Custom Colors have changed after having applied the above function to the illustrated screenshot image:

No comments:

Post a Comment

How to Run a Silent Console Application in Delphi

 Author: PETER ASCHBACHER (PA-SOFT) Sometimes, it's necessary to hide the console window of a CONSOLE APPLICATION entirely to avoid dist...