Creating noise images with Python and OpenGL

Main Question or Discussion Point

Hi

I am learning how to do a line integral convolution with OpenGL given a vector field. So, as a first step, I need to learn how to create an nxn noise image. Are there any good tutorials/books I can use to learn how to do this?

Related Programming and Computer Science News on Phys.org
jedishrfu
Mentor
Here's one way:

Python:
import random
n=3
nxn = [[random.random() for i in range(n)] for j in range(n)]
You can replace random.random() with an expression to magnify the random values as random.random() values vary from 0.0 to 1.0

so 5*randomrandom() will give you a spread of 0.0 to 5.0

and (5*randomrandom()+3) will give you a range of 3.0 to 8.0 as examples.

Avatrin
Alright, but this doesn't output an image. That's why I am asking for a tutorial or a book; I am not sure a forum post is gonna tell me how to create images with OpenGL.