[Numpy-discussion] So I found a bug...

Robert Kern robert.kern at gmail.com
Fri Feb 27 18:04:42 EST 2015


On Fri, Feb 27, 2015 at 10:33 PM, Sturla Molden <sturla.molden at gmail.com>
wrote:
>
> Somewhere... But where is it?
>
> NumPy, SciPy, Matplotlib, Cython or ipython?
>
> I am suspecting ipython, but proving it is hard...
>
>
http://nbviewer.ipython.org/urls/dl.dropboxusercontent.com/u/12464039/lenna-bug.ipynb

When plt.imshow() is given floating point RGB images, it assumes that each
channel is normalized to 1. You are mixing a 0..255 image with a 0..1
image. Divide `lenna` by 255.0 before you stack it with `_dct`. Or multiply
`_dct` by 255 and cast it to uint8.

--
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150227/6f31686b/attachment.html>


More information about the NumPy-Discussion mailing list