How do I convert a numpy array to (and display) an image?

Posted by jlswint on Stack Overflow See other posts from Stack Overflow or by jlswint
Published on 2010-04-17T17:28:30Z Indexed on 2010/04/17 17:33 UTC
Read the original article Hit count: 183

Filed under:
|
|
|

I have created an array thusly:

import numpy as np
data = np.zeros( (512,512,3), dtype=np.uint8)
data[256,256] = [255,0,0]

What I want this to do is display a single red dot in the center of a 512x512 image. (At least to begin with... I think I can figure out the rest from there)

© Stack Overflow or respective owner

Related posts about python

Related posts about numpy