Agg GraphicsContext doesn't seem to be properly converting pixel formats.
Open
- Dominant language
- C
- Stars
- 97
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
The following code example illustrates the problem:
```
from numpy import array, linspace, meshgrid, ones, uint8
from enthought.kiva.backend_image import GraphicsContext, Image
x,y = meshgrid(linspace(0.0, 1.0, 7), linspace(0.0, 1.0, 7))
z = (x*y*255).astype(uint8)
alpha = ones(z.shape, dtype=uint8) * 255
bmp_data = array((z,z,z,alpha)).T
img = GraphicsContext(bmp_data, pix_format="rgba32")
img.save("image.png")
gc = GraphicsContext((400,400), pix_format="rgba32")
gc.draw_image(img, (0, 0, 400, 400))
gc.save("rgba32.png")
```
https://svn.enthought.com/enthought/ticket/1293
Contributor guide
Assessment
This issue has not been assessed yet.