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 read color values of pixels in image?

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
yogiyang Posted - Jan 23 2019 : 02:40:32
Hello,

This is for the first time that I have a need to actually scan all the pixels of the loaded image and select pixels based of a few rules as defined by user.

How can we read the individual values of R G B of each pixel and select those pixels as per user entered rules?

TIA


Yogi Yang
2   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Jan 23 2019 : 06:52:03
Klaus,

Thanks for the code sample. I finally managed to get it working and it is quite fast also!

Once again thanks of the code.

TIA


Yogi Yang
klausdoege Posted - Jan 23 2019 : 03:48:29
Hi Yogi,
use: TImageEnView.SelectCustom

Example:
for y := 0 to ImageEnView1.IEBitmap.Height - 1 do
  for x := 0 to ImageEnView1.IEBitmap.Width - 1 do
  begin
    color := ImageEnView1.IEBitmap.Pixels[x, y];
    if ( color = clBlue ) or ( color = clGreen ) then
    begin
      ImageEnView.SelectionMask.SetPixel(X, Y, 255);
      ImageEnView.SelectCustom();
    end;
  end;


Klaus
www.klausdoege.de