Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Benjamin Root
On Wed, Feb 9, 2011 at 7:22 PM, Eric Firing wrote: > On 02/09/2011 02:29 PM, Benjamin Root wrote: > > > > > Bug Report: > > > > At some point between the recent revision and r8934, setting the alpha > > value to anythhing but None will cause the image to not show. I suspect > > it has something

Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Eric Firing
On 02/09/2011 02:29 PM, Benjamin Root wrote: > > Bug Report: > > At some point between the recent revision and r8934, setting the alpha > value to anythhing but None will cause the image to not show. I suspect > it has something to do with some of the recent revisions. Maybe the > alpha values w

Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Christoph Gohlke
On 2/9/2011 4:29 PM, Benjamin Root wrote: On Wed, Feb 9, 2011 at 1:50 AM, Eric Firing mailto:efir...@hawaii.edu>> wrote: On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > Please consider the attached patch for the _image.frombyte function. It > avoids temporary c

Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Eric Firing
On 02/09/2011 02:29 PM, Benjamin Root wrote: > On Wed, Feb 9, 2011 at 1:50 AM, Eric Firing > wrote: > > On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > > > > > Please consider the attached patch for the _image.frombyte > function. It > >

Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Eric Firing
On 02/09/2011 12:36 PM, Benjamin Root wrote: > On Wed, Feb 9, 2011 at 1:50 AM, Eric Firing > wrote: > > On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > > > > > Please consider the attached patch for the _image.frombyte > function. It > >

Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Benjamin Root
On Wed, Feb 9, 2011 at 1:50 AM, Eric Firing wrote: > On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > > > > > Please consider the attached patch for the _image.frombyte function. It > > avoids temporary copies in case of non-contiguous input arrays. Copying > > a 1024x1024 slice out of a con

Re: [Matplotlib-users] Trouble with imshow

2011-02-09 Thread Benjamin Root
On Wed, Feb 9, 2011 at 1:50 AM, Eric Firing wrote: > On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > > > > > Please consider the attached patch for the _image.frombyte function. It > > avoids temporary copies in case of non-contiguous input arrays. Copying > > a 1024x1024 slice out of a con

Re: [Matplotlib-users] Trouble with imshow

2011-02-08 Thread Eric Firing
On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > Please consider the attached patch for the _image.frombyte function. It > avoids temporary copies in case of non-contiguous input arrays. Copying > a 1024x1024 slice out of a contiguous 4096x4096 RGBA or RGB array is > about 7x faster (a common

Re: [Matplotlib-users] Trouble with imshow

2011-02-08 Thread Christoph Gohlke
On 2/5/2011 1:02 PM, Eric Firing wrote: On 02/04/2011 02:03 PM, Christoph Gohlke wrote: [...] How about these changes to color.py (attached). This avoids copies, uses in-place operations, and calculates single precision when normalizing small integer and float32 arrays. Similar could be done

Re: [Matplotlib-users] Trouble with imshow

2011-02-05 Thread Eric Firing
On 02/04/2011 02:03 PM, Christoph Gohlke wrote: [...] > > How about these changes to color.py (attached). This avoids copies, uses > in-place operations, and calculates single precision when normalizing > small integer and float32 arrays. Similar could be done for LogNorm. Do > masked arrays suppor

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Christoph Gohlke
On 2/4/2011 3:29 PM, Eric Firing wrote: On 02/04/2011 12:33 PM, Christoph Gohlke wrote: On 2/4/2011 2:14 PM, Eric Firing wrote: On 02/04/2011 11:33 AM, Eric Firing wrote: On 02/04/2011 10:28 AM, Christoph Gohlke wrote: On 2/4/2011 11:54 AM, Eric Firing wrote: On 02/03/2011 05:35 PM, Ch

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Eric Firing
On 02/04/2011 12:33 PM, Christoph Gohlke wrote: > > > On 2/4/2011 2:14 PM, Eric Firing wrote: >> On 02/04/2011 11:33 AM, Eric Firing wrote: >>> On 02/04/2011 10:28 AM, Christoph Gohlke wrote: On 2/4/2011 11:54 AM, Eric Firing wrote: > On 02/03/2011 05:35 PM, Christoph Gohlke wrot

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Christoph Gohlke
On 2/4/2011 2:14 PM, Eric Firing wrote: > On 02/04/2011 11:33 AM, Eric Firing wrote: >> On 02/04/2011 10:28 AM, Christoph Gohlke wrote: >>> >>> >>> On 2/4/2011 11:54 AM, Eric Firing wrote: On 02/03/2011 05:35 PM, Christoph Gohlke wrote: > > > On 2/3/2011 6:50 PM, Eric Firing wrot

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Eric Firing
On 02/04/2011 11:33 AM, Eric Firing wrote: > On 02/04/2011 10:28 AM, Christoph Gohlke wrote: >> >> >> On 2/4/2011 11:54 AM, Eric Firing wrote: >>> On 02/03/2011 05:35 PM, Christoph Gohlke wrote: On 2/3/2011 6:50 PM, Eric Firing wrote: > On 02/03/2011 03:04 PM, Benjamin Root wrote

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Eric Firing
On 02/04/2011 10:28 AM, Christoph Gohlke wrote: > > > On 2/4/2011 11:54 AM, Eric Firing wrote: >> On 02/03/2011 05:35 PM, Christoph Gohlke wrote: >>> >>> >>> On 2/3/2011 6:50 PM, Eric Firing wrote: On 02/03/2011 03:04 PM, Benjamin Root wrote: > Also, not to sound too annoying, but has

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Christoph Gohlke
On 2/4/2011 11:54 AM, Eric Firing wrote: > On 02/03/2011 05:35 PM, Christoph Gohlke wrote: >> >> >> On 2/3/2011 6:50 PM, Eric Firing wrote: >>> On 02/03/2011 03:04 PM, Benjamin Root wrote: >>> Also, not to sound too annoying, but has anyone considered the idea of using compressed arrays

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Eric Firing
On 02/03/2011 05:35 PM, Christoph Gohlke wrote: > > > On 2/3/2011 6:50 PM, Eric Firing wrote: >> On 02/03/2011 03:04 PM, Benjamin Root wrote: >> >>> Also, not to sound too annoying, but has anyone considered the idea of >>> using compressed arrays for holding those rgba values? >> >> I don't see ho

Re: [Matplotlib-users] Trouble with imshow

2011-02-04 Thread Pauli Virtanen
Thu, 03 Feb 2011 16:37:31 -0800, Christoph Gohlke wrote: [clip] > My understanding is that if there is a circular reference then the > refcount will not be zero anyway. In this case _AxesImageBase instances > and their image caches will never be deleted by the gc (__del__ method > present or not) u

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Christoph Gohlke
On 2/3/2011 6:50 PM, Eric Firing wrote: On 02/03/2011 03:04 PM, Benjamin Root wrote: Also, not to sound too annoying, but has anyone considered the idea of using compressed arrays for holding those rgba values? I don't see how that really helps; as far as I know, a full rgba array has to be

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Eric Firing
On 02/03/2011 03:04 PM, Benjamin Root wrote: > Also, not to sound too annoying, but has anyone considered the idea of > using compressed arrays for holding those rgba values? I don't see how that really helps; as far as I know, a full rgba array has to be passed into agg. What *does* help is us

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Benjamin Root
On Thu, Feb 3, 2011 at 6:37 PM, Christoph Gohlke wrote: > > > On 2/3/2011 3:13 PM, Eric Firing wrote: > > On 02/03/2011 01:02 PM, Christoph Gohlke wrote: > >> > >> > >> On 2/3/2011 2:44 PM, Eric Firing wrote: > >>> On 02/03/2011 12:28 PM, Christoph Gohlke wrote: > > > On 2/3/2011 2

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Christoph Gohlke
On 2/3/2011 3:13 PM, Eric Firing wrote: > On 02/03/2011 01:02 PM, Christoph Gohlke wrote: >> >> >> On 2/3/2011 2:44 PM, Eric Firing wrote: >>> On 02/03/2011 12:28 PM, Christoph Gohlke wrote: On 2/3/2011 2:15 PM, Eric Firing wrote: > On 02/03/2011 11:30 AM, Robert Abiad wrote: >

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Eric Firing
On 02/03/2011 01:02 PM, Christoph Gohlke wrote: > > > On 2/3/2011 2:44 PM, Eric Firing wrote: >> On 02/03/2011 12:28 PM, Christoph Gohlke wrote: >>> >>> >>> On 2/3/2011 2:15 PM, Eric Firing wrote: On 02/03/2011 11:30 AM, Robert Abiad wrote: > On 2/3/2011 10:06 AM, Eric Firing wrote: >>

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Christoph Gohlke
On 2/3/2011 2:44 PM, Eric Firing wrote: > On 02/03/2011 12:28 PM, Christoph Gohlke wrote: >> >> >> On 2/3/2011 2:15 PM, Eric Firing wrote: >>> On 02/03/2011 11:30 AM, Robert Abiad wrote: On 2/3/2011 10:06 AM, Eric Firing wrote: > On 02/02/2011 10:17 PM, Eric Firing wrote: >> On 02/02

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Eric Firing
On 02/03/2011 12:28 PM, Christoph Gohlke wrote: > > > On 2/3/2011 2:15 PM, Eric Firing wrote: >> On 02/03/2011 11:30 AM, Robert Abiad wrote: >>> On 2/3/2011 10:06 AM, Eric Firing wrote: On 02/02/2011 10:17 PM, Eric Firing wrote: > On 02/02/2011 08:38 PM, Robert Abiad wrote: >> > [.

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Christoph Gohlke
On 2/3/2011 2:15 PM, Eric Firing wrote: > On 02/03/2011 11:30 AM, Robert Abiad wrote: >> On 2/3/2011 10:06 AM, Eric Firing wrote: >>> On 02/02/2011 10:17 PM, Eric Firing wrote: On 02/02/2011 08:38 PM, Robert Abiad wrote: > [...] > I'll put it in as an enhancement, but I'm still

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Eric Firing
On 02/03/2011 11:30 AM, Robert Abiad wrote: On 2/3/2011 10:06 AM, Eric Firing wrote: On 02/02/2011 10:17 PM, Eric Firing wrote: On 02/02/2011 08:38 PM, Robert Abiad wrote: [...] I'll put it in as an enhancement, but I'm still unsure if there is a bug in there as well. Is there something I s

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Robert Abiad
On 2/3/2011 10:06 AM, Eric Firing wrote: > On 02/02/2011 10:17 PM, Eric Firing wrote: >> On 02/02/2011 08:38 PM, Robert Abiad wrote: >>> >> [...] >>> I'll put it in as an enhancement, but I'm still unsure if there is a >>> bug in >>> there as well. Is there something I should be doing to clear memo

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Eric Firing
On 02/02/2011 10:17 PM, Eric Firing wrote: > On 02/02/2011 08:38 PM, Robert Abiad wrote: >> > [...] >> I'll put it in as an enhancement, but I'm still unsure if there is a >> bug in >> there as well. Is there something I should be doing to clear memory >> after the >> first figure is closed other t

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Christoph Gohlke
As a workaround you could do your own normalization and color mapping and pass a uint8 RGB image to imshow. That avoids matplotlib's norm function. The following example saves almost 500 MB for plotting a 16 MB uint8 greyscale image, as compared to passing img directly to imshow: import numpy

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Eric Firing
On 02/02/2011 08:38 PM, Robert Abiad wrote: [...] I'll put it in as an enhancement, but I'm still unsure if there is a bug in there as well. Is there something I should be doing to clear memory after the first figure is closed other than close()? I don't understand why memory usage grows eac

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread gary ruben
Christoph, if you're looking at special casing uint8's, you might want to keep in mind that uint16 greyscale images are also quite common as camera outputs in experimental setups. I think that the solution to this should ideally minimise memory usage for any greyscale image, be it uint8, uint16, fl

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Robert Abiad
On 2/2/2011 6:06 PM, Eric Firing wrote: > On 02/02/2011 03:08 PM, Robert Abiad wrote: >> On 2/2/2011 3:59 PM, Christoph Gohlke wrote: >>> On 2/2/2011 3:33 PM, Robert Abiad wrote: Hello All, I'm very new to python, so bear with me. I'd like to use python to do my image pro

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Christoph Gohlke
On 2/2/2011 8:22 PM, Benjamin Root wrote: > On Wed, Feb 2, 2011 at 8:06 PM, Eric Firing > wrote: > > On 02/02/2011 03:08 PM, Robert Abiad wrote: > > On 2/2/2011 3:59 PM, Christoph Gohlke wrote: > > > On 2/2/2011 3:33 PM, Robert Abiad wrote: > > >> Hell

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Benjamin Root
On Wed, Feb 2, 2011 at 8:06 PM, Eric Firing wrote: > On 02/02/2011 03:08 PM, Robert Abiad wrote: > > On 2/2/2011 3:59 PM, Christoph Gohlke wrote: > >> On 2/2/2011 3:33 PM, Robert Abiad wrote: > >>> Hello All, > >>> > >>> I'm very new to python, so bear with me. > >>> > >>> I'd like to use python

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Christoph Gohlke
On 2/2/2011 6:06 PM, Eric Firing wrote: On 02/02/2011 03:08 PM, Robert Abiad wrote: On 2/2/2011 3:59 PM, Christoph Gohlke wrote: On 2/2/2011 3:33 PM, Robert Abiad wrote: Hello All, I'm very new to python, so bear with me. I'd like to use python to do my image processing, but I'm running in

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Eric Firing
On 02/02/2011 03:08 PM, Robert Abiad wrote: > On 2/2/2011 3:59 PM, Christoph Gohlke wrote: >> On 2/2/2011 3:33 PM, Robert Abiad wrote: >>> Hello All, >>> >>> I'm very new to python, so bear with me. >>> >>> I'd like to use python to do my image processing, but I'm running into >>> behavior that do

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Christoph Gohlke
On 2/2/2011 5:08 PM, Robert Abiad wrote: > On 2/2/2011 3:59 PM, Christoph Gohlke wrote: >> On 2/2/2011 3:33 PM, Robert Abiad wrote: >>> Hello All, >>> >>> I'm very new to python, so bear with me. >>> >>> I'd like to use python to do my image processing, but I'm running into >>> behavior that doe

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Robert Abiad
On 2/2/2011 3:59 PM, Christoph Gohlke wrote: > On 2/2/2011 3:33 PM, Robert Abiad wrote: >> Hello All, >> >> I'm very new to python, so bear with me. >> >> I'd like to use python to do my image processing, but I'm running into >> behavior that doesn't make >> sense to me. I'm using Windows 7 Pro (

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread gary ruben
You might want to try out the visvis module instead of matplotlib for interactive viewing of large 2D images - my system is also Win64 with 4GB and visvis.imshow() handles a 4k*4k image. You'll probably also want to disable ipython's object caching if you're doing a lot of this interactive viewing

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Christoph Gohlke
On 2/2/2011 3:33 PM, Robert Abiad wrote: > Hello All, > > I'm very new to python, so bear with me. > > I'd like to use python to do my image processing, but I'm running into > behavior that doesn't make > sense to me. I'm using Windows 7 Pro (64-bit) with 4 gigs of memory, python > 2.6.6, and th

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Benjamin Root
On Wed, Feb 2, 2011 at 5:33 PM, Robert Abiad wrote: > Hello All, > > I'm very new to python, so bear with me. > > I'd like to use python to do my image processing, but I'm running into > behavior that doesn't make > sense to me. I'm using Windows 7 Pro (64-bit) with 4 gigs of memory, > python 2.