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
 how to colorize a color range / faster

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
jcf Posted - Aug 16 2013 : 04:44:14
hello, i'm trying to add a "false colors" effect to my pics, using selectcolors and colorize:

ImageEnView1.SelectColors(CreateRGB(127,127,127),CreateRGB(178,178,178));
ImageEnView1.Proc.Colorize(50, 75, 1);
imageenview1.DeSelect;

My example colorize the range 50%-70% in yellow, after converting the pic in Gray.

BUT: as i'm colorizing 4 or 5 different ranges, the selection and deselection is pretty slow for each region: around 15 secondes to colorize two ranges of color in a 4K picture !

Is there any solution to keep do the same job without the selection, faster ? a colorize function with a range i can choose, like castcolorrange ?
(Previously i was using ImageEnView1.Proc.CastColorRange(BeginColor,EndColor,CastColor); but it doesn't keep the shades, it makes only one flat color for all shades selected).

Here is attached an example i want to make.

7   L A T E S T    R E P L I E S    (Newest First)
jcf Posted - Feb 23 2014 : 12:07:27
still slow with version 5.0.
jcf Posted - Oct 28 2013 : 00:34:47
Thanks, i'm gonna try.
JC
fab Posted - Sep 30 2013 : 13:44:39
Yes, 5.0 includes optimized version.
jcf Posted - Sep 25 2013 : 13:35:39
> Fab: is the version 5.0 including optimized version ?

>davenovo: Thanks, i'm gonna try, if it doesn't take too much time to compute the color table everytime i want a new range into a new color...
davenovo Posted - Sep 19 2013 : 10:03:36
You can use MapGrayToColor. It requires you precomute the color table, but then you don't have to make any selections.
jcf Posted - Sep 18 2013 : 14:30:53
Hi,
thank you for your response.
I'm using the 4.3.1.
so i'm gonna wait for the next version...
Thanks.
JC
fab Posted - Sep 06 2013 : 01:45:28
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.