|
From: Eric F. <ef...@ha...> - 2011-02-10 01:12:38
|
On 02/09/2011 02:29 PM, Benjamin Root wrote:
> On Wed, Feb 9, 2011 at 1:50 AM, Eric Firing <ef...@ha...
> <mailto:ef...@ha...>> 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 contiguous 4096x4096 RGBA or RGB array is
> > about 7x faster (a common case for zooming/panning). Copying
> contiguous
> > RGB input arrays is ~2x faster. Tested on win32-py2.7.
> >
> > Christoph
> >
>
> Thank you!
>
> Looks good, speeds up zooming and panning on large images as advertised.
> An 8000x8000 image is actually manageable now.
> interpolation='nearest' is still very slow until the image is
> substantially zoomed, but everything is quite quick with other
> interpolation styles. The slowness of 'nearest' looks like a basic
> characteristic of the implementation.
>
> I committed the patch in 8966.
>
> Before that I found and committed a big speed-up in Normalize.
>
> Eric
>
>
> 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 were being converted into an integer, causing them to be
> zero? Then again, even setting alpha to 1 will cause the image to
> disappear.
>
> Ideas? Thoughts? I included an example script below.
Thanks for the report. I'll fix it some time today.
Eric
>
> Ben Root
>
>
> Example script:
>
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> z = np.random.random((40, 50))
>
> fig = plt.figure()
> ax = fig.add_subplot(1, 2, 1)
> ax.imshow(z, alpha=1.0)
> ax.set_title('Blank!')
>
> ax = fig.add_subplot(1, 2, 2)
> ax.imshow(z, alpha=None)
> ax.set_title("Not Blank")
>
>
>
> plt.show()
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|