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
 Intelligent color reducing algorithm?

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
PeterPanino Posted - Apr 14 2024 : 10:28:38
I am looking for a content-based color-reducing algorithm that intelligently simplifies an image's colors by detecting the most used colors and reducing them to a few primary colors. It should reduce the palette to the most significant colors while maintaining the image's overall appearance.

How can I do this in ImageEn, perhaps with IEVision?
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 15 2024 : 04:33:43
Hi

I can't see a better way of doing that.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Apr 14 2024 : 23:41:06
Hi Nigel

I use this code to reduce the colors each time I click:

procedure TformPreview.mReduceColorsClick(Sender: TObject);
const
  ColorThresholds: array[0..6] of Integer = (256, 128, 64, 32, 16, 8, 4);
var
  CC, i: Integer;
begin
  CC := ImageEnViewPreview.Proc.CalcImageNumColors();
  for i := Low(ColorThresholds) to High(ColorThresholds) do
  begin
    if CC > ColorThresholds[i] then
    begin
      ImageEnViewPreview.Proc.ConvertTo(ColorThresholds[i], ieOrdered);
      Break; // Ensures the loop breaks after applying the first valid conversion
    end;
  end;
  ImageEnViewPreview.Update;
end;


How would you optimize this?
xequte Posted - Apr 14 2024 : 19:20:28
Hi

Yes, you can use ConvertTo:

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

It will reduce colors in a optimized way, either using the Kohonen algorithm or median cut:

https://www.imageen.com/help/TIEGlobalSettings.ColorReductionQuality.html

Nigel
Xequte Software
www.imageen.com