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
 Click and Remove a color
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Apr 03 2015 :  08:57:37  Show Profile  Reply
I am looking for an example to be able to click to select a color from the image and remove, both globally across the entire image or spot removal (remove only the clicked ones). There should be some kind of tolerance control on how much to remove?

Thanks in advance.

Andy

AndyColmes

USA
351 Posts

Posted - Apr 03 2015 :  10:35:10  Show Profile  Reply
Actually, to be more specific, I need to be able to automate the removal of the green lines in my images (called the die cut lines). Is using the color removal method the best way to go but I am afraid that it might remove other parts of the image if the color matches.

Thanks again and I look forward to your recommendation.

Andy


Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 03 2015 :  12:26:08  Show Profile  Reply
Removing the lines with the green color will affect all the green colors in the entire image.
CastColorRange(BeginColor, EndColor, CastColor: TRGB);
Description
Set all colors in the range BeginColor to EndColor to CastColor.

As far as I understand ImageEn, it is not possible to fully automate changing the color of a particular hue.

In addition, if you inspect the color values of the green pixels in your sample image you will find that the "green" colors are all various shades of green (There are at least 15 shades of green in your sample image and probably more.) and most have different integer values so the trick is to be able to pick all the shades of green that are to be removed. This is not easy to do. The only way to remove similar colors of "green" is to use the Remove Colors demo I posted here:
www.ImageEn.com/files/Other/SelectSimilarPaletteColors.zip

But even that has trouble with some of the dark shades of green in the particular image you posted. I suspect the problem is because the demo only tries to work with the 255 palette colors in the image and not all the colors. If you changed the demo to work with all colors in the image there would be so many colors of a green hue that you could detect with the human eye, it would be impossible to select them all. For the most part the demo does a good job, if you select the correct colors it will indeed change the color of the pixels matching the selected colors, but in the case of your particular image it does not.

If ImageEn featured magnetic selections of all similar colors or hues of a color in the image, it might be possible to automate, but right now there is no way to do so.

Colors are very deceiving even to the human eye. For example some of the pixels in your sample image that appear mostly gray have a hint of green, (the text) but that may be just my eyes.

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

xequte

38616 Posts

Posted - Apr 04 2015 :  01:54:32  Show Profile  Reply
Hi Andy

Also, the lines seem to be anti-aliased so you would need a range of green to remove. I suspect you may need to write your own algorithm to parse the scanlines and remove the green with some error checking to avoid false positives (distance from the sides???).


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Apr 05 2015 :  16:09:27  Show Profile  Reply
Thank you Bill and Nigel as usual. The task is more difficult than I thought. I will give it a try.
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Apr 22 2015 :  03:29:31  Show Profile  Reply
Hello Bill and Nigel,

Using CastColorRange or CastColor, can it be limited to a selection? Currently it replaces the color for the entire image. I need a little more control on what or where the color is replaced. Is this possible?

Thanks to you both.

Andy
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 22 2015 :  13:16:52  Show Profile  Reply
Did you try my ColorPalette example I refereed to you earlier? I am afraid there is no other way at the moment to precisely select similar colors.

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

AndyColmes

USA
351 Posts

Posted - Apr 22 2015 :  17:24:23  Show Profile  Reply
Hi Bill, yes I have downloaded your demo and I am trying to understand if I could replace the color using CastColorRange limited to a selection like a polygon or rectangle over an area and not the entire image. Is there a way to do that? Or do I have to maybe resort to copying out the bitmap of the selection, do the color replace and then replace back the bitmap of the selection?

Thanks again for all your help.

Andy
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 22 2015 :  18:18:05  Show Profile  Reply
As far as I understand it is not possible to replace only the colors in a selection. It probably would require a new ImageEn method or an overloaded method to do that.

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

AndyColmes

USA
351 Posts

Posted - Apr 23 2015 :  19:25:19  Show Profile  Reply
Thanks Bill. I guess I have to resort to copying out the selection and do the replace. What or how is the best way to copy the selection to bitmap or to another TImageEnView and pasting it back to the same selection again?

Andy
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: