A
A
abrillian2020-01-04 16:43:05
PHP
abrillian, 2020-01-04 16:43:05

How to replace color in an image using js or php?

Hello. There are images of carpets on which it is necessary to replace the colors using js or php, but in such a way that the texture is preserved. OpenCV does not see the edge of the image in either hsv or rgb as the colors are very similar.
or I'm doing something wrong, but when choosing orange, yellow also gets into the sample. Just like gray goes with dark gray. There are 5 colors in the photo.
Tell me how with the help of which js library this can be implemented.
I am attaching an example for clarity:
5e109748547db742384479.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Matviychuk, 2020-01-04
@iliya2004

Hello, try with css and hue-rotate:
elem.style.filter='hue-rotate(45deg)'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question