I'm working on a singular value decomposition demo for my linear algebra
class, and it's super easy to read in an image and get the red, green,
and blue channels:

sage: import pylab
sage: img = pylab.imread('filename.png')
sage: parent(img)
<type 'numpy.ndarray'>
sage: img.shape
(13, 7, 3)

I can extract the arrays for red, green, and blue and plot those with
matrix_plot():

sage: matrix_plot(img[...,0])

...but I don't know how to combine those channels and display the color
image. I can get a matplotlib image:

sage: pylab.imshow(img)
<matplotlib.image.AxesImage object at 0x6fbbc50>

How do I display such an object?

What I would really like is for matrix_plot to accept three matrices of
the same shape and show a color image. Can I do this? Should I open an
enhancement ticket?

Dan

--
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to