nannou icon indicating copy to clipboard operation
nannou copied to clipboard

Colormapping and render-to-texture

Open polygon opened this issue 3 years ago • 0 comments

I've been working on a program that iteratively creates an image that is monochrome. I do so by drawing to an initially fully black frame using white color and low alpha values and not clear the image between frames.

This works pretty well so far, but I'd like to go one step further and have a colormapping to make the output a bit more interesting. Essentially, there would be a function

fn colormap(in: Color) -> Color;

between the image that I draw to and what is actually shown on screen. However, I am currently lost how I would do this in Nannou. I'd have to draw to some kind of texture or off-screen surface for my actual grayscale data and then pixel-by-pixel map to the actual output colors.

I'm pretty new to Nannou so I hope the question isn't too naive. But is it possible to do what I want to achieve?

polygon avatar Mar 28 '21 18:03 polygon