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
 Click and Remove a color

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
AndyColmes Posted - Apr 03 2015 : 08:57:37
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
9   L A T E S T    R E P L I E S    (Newest First)
AndyColmes Posted - Apr 23 2015 : 19:25:19
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
w2m Posted - Apr 22 2015 : 18:18:05
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
AndyColmes Posted - Apr 22 2015 : 17:24:23
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
w2m Posted - Apr 22 2015 : 13:16:52
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
AndyColmes Posted - Apr 22 2015 : 03:29:31
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
AndyColmes Posted - Apr 05 2015 : 16:09:27
Thank you Bill and Nigel as usual. The task is more difficult than I thought. I will give it a try.
xequte Posted - Apr 04 2015 : 01:54:32
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
w2m Posted - Apr 03 2015 : 12:26:08
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
AndyColmes Posted - Apr 03 2015 : 10:35:10
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