T O P I C R E V I E W |
yogiyang |
Posted - Oct 13 2021 : 00:49:43 Hello,
I am trying to calculate the most used color. Meaning I want to find that color which has largest number of pixels in a JPEG image.
Currently I am using IEBitmap.ScanLine and building an unique array of colors and then counting each color in the array.
But this process is taking a lot of time especially when the image is big (30 MB and higher).
Is there any better way to achieve this in a faster and accurate manner?
TIA
Yogi Yang |
3 L A T E S T R E P L I E S (Newest First) |
xequte |
Posted - Oct 17 2021 : 23:36:26 Hi Yogi
I have done some testing of GetDominantColor today. I could not find any issues. Can you forward your test images.
Nigel Xequte Software www.imageen.com
|
yogiyang |
Posted - Oct 16 2021 : 07:29:51 Hello Nigel,
Thanks for the reply.
I also tried to improve speed by switching to MyRGB := ieTemp.IEBitmap.Pixels[X, Y];
But this also does not make any difference.
I used function Proc.GetDominantColor but the color returned by it and that calculated by my code are different. And the color returned by Proc.GetDominantColor does not match visually when we look at the image and the color returned by this function. But on the contrary the color calculated by my code matches visually with the image.
TIA
Yogi Yang |
xequte |
Posted - Oct 13 2021 : 21:50:09 Hi Yogi
You can also use:
https://www.imageen.com/help/TImageEnProc.GetDominantColor.html
But if you already have a good algorithm using scanlines, it may be not be any faster.
Nigel Xequte Software www.imageen.com
|