[Numpy-discussion] Using where with tuples

2009-04-10 Thread Frank Peacock
Hello I am trying to use the where function on a numpy array which was obtained from an image using the asarray function. The code is as follows: from numpy import * from Image import * im=open("a.gif") im2=im.convert("RGBA") a2 = asarray(im2,uint8) c = zeros((140,90,4),uint8) c[:,:]

[Numpy-discussion] Constant array of tuples

2009-04-10 Thread Frank Peacock
: DVCS at PyCon (Matthieu Brucher) 5. numpy import on x86_64 arch (Vincent Thierion) 6. Re: numpy import on x86_64 arch (David Cournapeau) 7. Replacing colours in numpy array (Frank Peacock) -- Message: 1 Date: Fri, 1

[Numpy-discussion] Replacing colours in numpy array 2

2009-04-10 Thread Frank Peacock
Hello Apologies for the incorrect posting before. The problem was that I was not using an array for the true condition and instead was using a scalar. Frank ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.

[Numpy-discussion] Replacing colours in numpy array

2009-04-10 Thread Frank Peacock
Hello I have a numpy array that I obtained from a converted RGBA gif image. I have tried to replace some colours with different ones using the where condition but have a problem with dimensions. If I use b=where(a==0,255,a) where a is a numpy array from an image it does replace components of the

[Numpy-discussion] Multiple draw text or paste image using numpy

2009-02-20 Thread Frank Peacock
Hello I am familiar with the fromarray function in the pil library Image module to plot pixels. Is it possible to do the same for drawtext for text or paste for images without looping with lists? Thanks Frank ___ Numpy-discussion mailing list

[Numpy-discussion] Initialize numpy array with other numpy arrays

2009-02-19 Thread Frank Peacock
Many thanks Robert. Frank ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Initialize numpy array with other numpy arrays

2009-02-19 Thread Frank Peacock
Hello I would like to know whether I can do the following in some other way as this fails with setting an array with a sequence on each of the colour arrays: h,w=720,410 img = ones((h,w,3), uint8)*255 img[ngridn,ngride]=(ncolour[0],ncolour[1],ncolour[2]) pilImage = Image.fromarray(img, '