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

Sierpinski Triangle Fractal version 2.0

 This is a substantial update from yesterday's article Creating a Fractal Art Application: Drawing the Sierpinski Triangle . What's ...