Replace a particular color inside an image with another color

后端 未结 4 768
长发绾君心
长发绾君心 2020-12-03 15:52

I have one \"room\" image.

Now, user will click on any particular color suppose blue color in image.

And also user will select replaced color like \"black\"

4条回答
  •  情深已故
    2020-12-03 16:25

    You'll need access to the raw pixel data somehow (see this answer or user Krishnabhadra's code). Search through all the pixels and eg for blue->black replacement, replace all blue pixels with black. Look at converting the colour to HSV which will make the colour replacement calculation easier.

提交回复
热议问题