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
 How to replace a color with another color in image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Dec 05 2018 :  05:04:51  Show Profile  Reply
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

wesleybobato

Brazil
367 Posts

Posted - Dec 05 2018 :  05:28:20  Show Profile  Reply
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.
Go to Top of Page

yogiyang

India
725 Posts

Posted - Dec 05 2018 :  09:55:47  Show Profile  Reply
Hello,

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

I will play with the idea.

TIA


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