-1

What would be a computationally inexpensive way of finding the night-mode of an image in canvas?

Doesn't have to superb just fast way to turn an image from visiually day to night.

Thanks a ton.

1
  • 2
    Your question is too vague. Can you please explain in further detail what you mean by "night mode"?
    – Peter O.
    Commented Mar 11, 2018 at 23:23

1 Answer 1

1

You'd have to experiment with different exact levels and values, but I'd desaturate the color, then dim the image, more strongly on the R and G components than the B component so that the resulting image was slightly blue-tinted.

Do you know how to draw an image into a canvas, grab the pixels, loop through the pixels to manipulate them, then draw them back?

1
  • I was thinking more of making the dimming layer and just layering it on top of the picture which I think should be faster and yes I do know that. But it's interesting I thought it was an already solved problem in image processing with a defined algorithm but I guess not. Thanks. Commented Mar 11, 2018 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.