To explain my example first is the original image.
Edit: Assuming it is placed on canvas using base64 data.
and this is the output with color applied is #ED7600
Now the image is converted into single shade. I have tried different canvas built in compositions. But none of them worked. A color manipulation algorithm can do it. I have some starter code so everyone may know the inputs.
let color_code = "#ED7600",
imageData = ctx.getImageData(0, 0, c.width, c.height);
data = imageData.data; // This is the color data I want to manipulate
for (var i = 0; i < data.length; i += 4) {
// Awesome algorithm goes here
}
I have already tried different solutions from stack overflow. But nothing exactly changed a multi color image into a single shade color. I am creating it for a printing company and in their business, single color print costs less so customer can have an option to see how it will look.