Re: Dominant color & PIL
For example: getdata im.getdata() => sequence Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on. Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()). So you could get them and count them in :) Don't know if you should do that on a 1600x1200 wallpaper tho :D Wim Terry Hancock wrote: > On Sun, 22 Jan 2006 21:07:45 +0100 > Sebastjan Trepca <[EMAIL PROTECTED]> wrote: > > I was wondering is it possible to find out which colour is > > dominant in an image using PIL? > > It would be very easy to create interesting mozaic images > > with that :) > > Shrink it to one pixel, and get that pixel's value. ;-) > > Seriously, that ought to do it. Bear in mind that you need > to use the right sampling mode (IIRC, you want ANTIALIAS). > > Cheers, > Terry > > -- > Terry Hancock ([EMAIL PROTECTED]) > Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list
Re: beta.python.org content
I am not a design professional but since you didn't ask for professionals but for beginners ;-) ... - At the left hand side you used abbreviations (like PSF). Using the full name says more about the option. - I don't like capitals alot either (as used in the menu). - The corporate look of the site might be something I need getting used too. - And I think the top part needs some nice images. Just python and logo is taking up too much space for what it shows. But it's a good change compared to the old site. That one was way too ascii ;-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Running a DOS exe file from python
Hello, Something like this: progname = 'c:\tmp\myprog.exe arg1 '+'-- help' os.system(r'progname) should work too. So you should be able to change progname to any location you need to start it and all the args to whatever is needed. -- http://mail.python.org/mailman/listinfo/python-list
Re: Mouse manipulation
arkestra schreef: > I am writing a script that interacts with the computer screen. > > Is there a module (either built in or add on) that would allow the > script to manipulate the mouse pointer ? -- eg right click, move two > pixels to the right, left click etc? > > thank you. pygame is able to do that. -- http://mail.python.org/mailman/listinfo/python-list
Re: how to remove using replace function?
Works for me. >>> txt = "an unfortunate in the middle" >>> print txt.replace("", "") an unfortunate in the middle >>> Though I don't like the 2 spaces it gives ;) -- http://mail.python.org/mailman/listinfo/python-list
Re: simple math question
'/' is a floor division (1/2 == 0) unless validated by a from __future__ import division. So: 5/2=2.5 -> nearest lowest non-decimal number makes it 2. 5/-2=-2.5 -> nearest lowest non-decilmal number makes it -3 -- http://mail.python.org/mailman/listinfo/python-list