ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 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
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

brandonbrown

USA
37 Posts

Posted - Dec 20 2021 :  19:57:00  Show Profile  Reply
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)

xequte

38194 Posts

Posted - Dec 21 2021 :  23:43:02  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: