Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I found a better solution by myself which can solve the problem with the black and white.</p> <p>So basically the solution can be solved in multiple steps. Here I will define the steps. Later I'll provide some working code:</p> <p><li> Get the image </li> <li>Calculate the predominant color, averaging the image pixels or simply providing an input RGB value which is the predominant that your eye can catch.</li> <li> If the predominant tends to be black or white, or both, the image has to be recolored with an addictive or subtractive method, addictive if black, subtractive if white. So basically all RGB pixels should be attenuated or sharpened until RED. I think that the best solution should be RED, because RED is first in the HUE scale, and this can help when we will hue-shift the pixels. </li> <li> To have a unique algorithm which can work with different kind of images, not only black predominant or white, ideally the input the non-black and non-white predominant images should be pre-hueshifted manually, using photoshop or with another algorithm in a way that the new predominant color results to be RED too </li> <li> After that the Hue shifting coloring is straighforward. We know that the predominant color is RED for all the images, and we'll shift the HUE values with a difference between the HSV value of the desired color and the HSV of the predominant color (RED). </li> <li>Game over. We have a pretty universal way to color different images with hue shifting in a natural way.</li> Another question could be how to authomatically pre-shift the input images which predominant color is not black or white. But this is another question.</p> <p>Why this coloring method could be considered natural. Simply consider one thing. Generally the non dominant black or white colors are part of the shadows and light which gives a 3D feel to the images. On the other hand if my shoes are 100% black and i will tint them with some colors, they will no more be black. Color the dominant black cannot be achieved simply shifting the HSV parameters but other steps should be performed. The steps are the above described.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload