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
 Red Drop Out, Dropping out of a specific color, or a color range

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
brandonbrown Posted - Dec 20 2021 : 19:57:00
Thank you to Nigel (as usual) for coming up with something simple!

I added layers to my project and noticed it had the ability to Substitute one color with another, but I am not getting it work. I have attached a sample of the red color I want to remove from a form. Some scanners do the red drop out, however I was going to try to do this in software.

In this case, attached, I want to change the red on the form to white. There are no other colors on the form, just red.

I added the image as a layer. It displayed way down in the ieviewer1.image window, but that's another question.

I tried different versions of the code below, but it just doesn't pick the red correctly. I tried a single color also, using paint and getting the eye dropper to give me the RGB numbers.

Am I missing something?

Dim newLayer As Integer = IeViewer1.Image.LayersAdd("c:\batches\20211220-0001.tif", -1000, -1000)

Dim oldColor1 As HiComponents.IEvolution.IERGB
Dim oldColor2 As HiComponents.IEvolution.IERGB
Dim newColor As HiComponents.IEvolution.IERGB

oldColor1.r = 255
oldColor1.g = 0
oldColor1.b = 0

oldColor2.r = 160
oldColor2.g = 255
oldColor2.b = 255

newColor.r = 255
newColor.g = 255
newColor.b = 255

IeViewer1.Image.SelectColors(oldColor1, oldColor2, HiComponents.IEvolution.IEImage.SelOp.Add)
IeViewer1.Image.SetSelectedPixelsColor(newColor)

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 21 2021 : 23:43:02
Hi

I think it would be easier just to use CastColorRange on the layer image:

https://www.imageen.com/ievolutionhelp/html/6b874a1e-69c0-a5f5-b2ed-772972afc4d6.htm

Nigel
Xequte Software
www.imageen.com