2010/3/20 Ciarán Mooney general.moo...@googlemail.com:
I am using PIL because I plan to plug in a Tkinter interface which can
directly accept PIL image instances.
You can render matplotlib figures to PIL using following code:
figure.set_size_inches(float(shape[0]) / figure.dpi, float(shape[1])
Hi,
I haven't tried it, but maybe it's to do with the fact that you're
quantising the colourmap to 256 values; I think matplotlib computes the
exact rgb values using interpolation. If the only reason you're using
PIL is to get a .bmp file, maybe you could save the file straight from
I haven't tried it, but maybe it's to do with the fact that you're
quantising the colourmap to 256 values; I think matplotlib computes the
exact rgb values using interpolation. If the only reason you're using
PIL is to get a .bmp file, maybe you could save the file straight from
matplotlib as
Hi,
I am trying to create an image from an array using PIL, numpy and a
colourmap from matplotlib.
I got the colourmap by using ipython and the following code
colourmap = []
for i in xrange(256):
r,g,b,a = cm.jet(i)
r = int(round((r * 255),0))
g = int(round((g * 255),0))
b =
2010/3/18 Ciarán Mooney general.moo...@googlemail.com:
value = (log(x)/log(largest))*255
Just two thoughts:
1) I doubt the statement cited above is not correct, as it may also
yield negative values as soon as 0 x 1. In fact, you are
calculating log_{largest}(x). This