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
 loop trough all pixels and change values

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
scpsolutions Posted - Jan 28 2023 : 17:19:40
Hi Everyone,

I have a bunch of images, thousands actually. And I need to make sure the background is pure white. I know how to get the images and scan folders and all that stuff. Just not sure how to modify individual pixels. Not looking for speed, as long as it works.

I know this will get subject and non-background pixels. But this will be one step of many so if the subject is modified will have to resort to photoshop or something maybe.

Example pseudo code

for w as image.width
  for h as image.height
   if image.pixel[w][h].r >=250 and  image.pixel[w][h].g > 250 and image.pixel[w][h].b > 250
   begin  //pixel is near white so force it to white
    image.pixel[w][h].r=255
    image.pixel[w][h].g=255
    image.pixel[w][h].b=255
    imagechanged=true
   end


Just to recap, just looking to loop trough all pixels and check pixel values and if they fit a criteria, change them.

Thanks!
Marc



Marc Ouellette
2   L A T E S T    R E P L I E S    (Newest First)
scpsolutions Posted - Jan 29 2023 : 21:22:23
HI Nigel,

That is just what I am looking for.

Thank you so much!

Marc

Marc Ouellette
xequte Posted - Jan 29 2023 : 16:58:16
Hi Marc

In terms of making colors close to white, purely white, you can use:

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

But that will apply to the whole image (or whatever is selected), so naturally it will also whiten any any near white parts of the image subject.

Nigel
Xequte Software
www.imageen.com