Hi,
TImageEnProc.SelectColors will be optimized for 24 bit RGB images, from next minor version. In my tests SelectColors will require about 600ms on a 4K image (on a i5/i7 Intel CPU).
In the mean time you could select pixel by pixel. For example:
var
i, j: integer;
p_rgb: PRGB;
...
for i := 0 to ImageEnView1.IEBitmap.Height - 1 do
begin
p_rgb := ImageEnView1.IEBitmap.ScanLine[i];
for j := 0 to ImageEnView1.IEBitmap.Width - 1 do
begin
with p_rgb^ do
if (r >= 127) and (g >= 127) and (b >= 127) and (r <= 178) and (g <= 178) and (b <= 178) then
ImageEnView1.SelectionMask.SetPixel(j, i, 1);
inc(p_rgb);
end;
end;
ImageEnView1.SelectCustom();
ImageEnView1.Proc.Colorize(50, 75, 1);
ImageEnView1.DeSelect;
This requires about the same time of optimized version.