Is there any way to change the color of the picture? the color conversion is as follows. You can modify the icon uploaded by the user to a picture dominated by red or yellow.

Mar.18,2021

simple color conversion can be achieved with canvas.

but I think the more difficult part is how to determine the color that needs to be converted, that is, to identify the problem.

take your picture as an example, you can see at a glance that you have changed the white color of the router into other colors, but in the actual code, you need to have a clear color value to decide whether to convert it or not. This value cannot be provided by the user. You can only rely on yourself to judge, that is, to find out the white color value.

you can rely on area, but this may conflict with the background.

can rely on shape, which increases the difficulty by several orders of magnitude.

in reality, the color that needs to be replaced is not necessarily the same value, and may be affected by light, shadow, etc., resulting in slight color differences, which is also to be considered.

the complete implementation of this set may be equivalent to a small beauty algorithm. It seems that this is also a corner requirement, you can look for an open source implementation to save some effort.

Menu