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
 How to replace a color with another color in image

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
yogiyang Posted - Dec 05 2018 : 05:04:51
Hello,

I have a need to replace a color as selected by user by clicking on an image with a color as selected by use.



In this image I want to replace the black color with blue color. I need to replace the color in such a way that all shared of black (and gray) should be replaced with blue as per their intensity (meaning if black is 100% then replace with blue at 100%).

Again none of the other colors (shades) should be disturbed.

How can we do this?

TIA


Yogi Yang
2   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Dec 05 2018 : 09:55:47
Hello,

Thanks for the links. Changing Hue never crossed my mind.

I will play with the idea.

TIA


Yogi Yang
wesleybobato Posted - Dec 05 2018 : 05:28:20
Hi Yogi

You need to work with changing the Hue
There are several examples here.

https://stackoverflow.com/questions/4642521/programmatically-swap-colors-from-a-loaded-bitmap-to-red-green-blue-or-gray-p

https://www.imageen.com/help/TImageEnProc.HSLvar.html
https://www.imageen.com/help/TImageEnProc.HSVvar.html

http://www.efg2.com/Lab/Library/Delphi/Graphics/Color.htm

https://www.google.com/search?q=delphi+bitmap+replace+color+hue

https://www.google.com/search?q=delphi+bitmap+replace+color

Kind regards.