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
 Colorize function in ImageEn

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
AndyColmes Posted - Aug 27 2016 : 17:34:32
In using some commercial imaging programs, there is a function called Colorize that can make a grayscale image into red. Is there such a function in ImageEn? I would like to automatically turn a grayscale image to color, and if possible different color shades without having to replace the color for each pixel, which could be slow.

Thank you for any help.

Andy
3   L A T E S T    R E P L I E S    (Newest First)
AndyColmes Posted - Aug 28 2016 : 05:11:28
Wow Bill, thank you very much for the tips.

Andy
w2m Posted - Aug 27 2016 : 19:14:43
TImageEnProc.MapGrayToColor

Declaration
procedure MapGrayToColor(map: array of TRGB);

Description
Maps each gray scale level to specified RGB color, using provided map.

var
  map: array [0 .. 255] of TRGB;
  i: Integer;  
for i := 0 to 255 do
begin
  map[i].r := i;
  map[i].g := 0;
  map[i].b := 0;
end;
ImageEnView.Proc.MapGrayToColor(map);
ImageEnView.Update;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
w2m Posted - Aug 27 2016 : 19:00:49
TImageEnProc.Colorize

Declaration
procedure Colorize(hue: Integer; saturation: Integer; luminosity: Double);

Description
Set the hue and saturation for all pixels of the image. It also adjusts the luminosity using a multiplier.

Parameter Description
hue A value between 0 and 359 (corresponding to 0 to 359 degrees around hexcone)
saturation A value between 0 (shade of gray) and 99 (pure color).
luminosity This is 1 if you don't touch the original luminosity. Whereas 1.1 would equate to 10% increase in luminosity, for example

Example
// Apply a sepia effect to the image
ImageEnView.Proc.Colorize(40, 50, 1.1);


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development