[matplotlib-devel] the 32768 pixel limit

2011-05-25 Thread Feng Yu
Dear list,

I am trying to work with matplotlib to plot on an AGG canvas of size
5x1100.

It seems to be the constraint is in AGG. Does anybody has experience
in this regard?


After removing the exception about the image size and replacing 'int'
with long long, figimage correctly puts an image and save to a rgba
raw file.

There are, however, two problems that I can't solve.

1 when the border rectangle(0,0) - (5, 0) - (5, 1100) - (0,
1100) - (0,0) is rendered, I see the scanlines all end up with a
length of 16636(which happens to be 65536 - 5). and nothing is
evidently drawn in the final image.

2  when I try to plot a circle at (4, 0). Nothing is shown and no
scanline is produced at all.

In both situation the vertices are correctly passed to the rasterizer.
Is there a version of Agg that can do with larger images?


Yu



Yu

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Alpha channel in imshow, bug or gamma correction?

2011-10-05 Thread Feng Yu
Dear Lists,

I tried to draw a white block with alpha-channel gradient on top of black.
The result appears to be non-linear, and I think it is problematic.

image = ones((255, 255, 4), dtype='u1')
image[:, :, 0:3] = 255
image[:, :, 3] = arange(0, 255)[:, newaxis]
gca().set_axis_bgcolor('k')
imshow(image)

The color of the pixel with alpha = 128 is about (30, 30, 30).
We can confirm this with
cla()
image[:, :, 3] = 128
imshow(image)

On Inkscape, a white block with alpha = 128 on top of a black box gives a
final color of r,g,b=128, 128, 128.

I did a rough fit and apparently matplotlib is calculating the final pixel
brightness with (notice the original pixel is 0)

r = cr * (alpha / 255.) ** 3 , (same for g and b)

shouldn't it be r = cr * alpha / 255?

This affects matplotlib-1.0.1 and a not so recent copy of the git
master(ba4043a35d4c2).


Regards,

Yu
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel