Re: [Image-SIG] ANN: PIL 1.2 pre-alpha (January 8, 2011)

2011-01-10 Thread Fredrik Lundh
2011/1/9 Glenn Linderman v+pyt...@g.nevcal.com: On 1/7/2011 5:41 PM, Fredrik Lundh wrote: It also builds under Python 3.1 and 3.2 beta, even if the functionality is currently *very* limited under Python 3.X. Is there any doc that describes what does or doesn't work under 3.X? Beyond that

[Image-SIG] Putting a unicode string on an ImageDraw canvas

2011-01-10 Thread Thomas Larsen Wessel
People are telling me that PIL supports unicode strings, does it? And if yes, why does the following not work: import ImageFont, Image, ImageDraw s = u'\u0623\u0636\u0641' im = Image.new('RGB', (200,200)) draw = ImageDraw.Draw(im) draw.text((40,40), s) #fails It results in the following

Re: [Image-SIG] Putting a unicode string on an ImageDraw canvas

2011-01-10 Thread Thomas Larsen Wessel
Thanks :) Here is an example that shows how both draw.text and draw.textsize works, as long as a unicode-supported font is supplied. It also shows how to get the text size directly from the font object. import ImageFont, Image, ImageDraw s = u'\u0623\u0636\u0641' font =

Re: [Image-SIG] Putting a unicode string on an ImageDraw canvas

2011-01-10 Thread Fredrik Lundh
2011/1/10 Thomas Larsen Wessel mrve...@gmail.com: Thanks :) Here is an example that shows how both draw.text and draw.textsize works, as long as a unicode-supported font is supplied. It also shows how to get the text size directly from the font object. import ImageFont, Image, ImageDraw s

Re: [Image-SIG] Locate The Center of WhiteDot from a Image

2011-01-10 Thread Chris Barker
On 1/7/2011 8:26 PM, Narendra Sisodiya wrote: If you need more math, numpy can help. Somethign like: a = np.asarray(PIL_image) background_color = 0 rows, cols = np.where(a background_color) # background color a uint32 BB = (rows.min(), rows.max(), cols.min(), cols.max()) I