Please test Phatch on Windows (was Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL)

2008-03-01 Thread SPE - Stani's Python Editor
actions on hundreds or thousands of images. If you know PIL and have some nice recipes laying around, it is very easy to write plugins asPhatchgenerates the corresponding GUI automagically just like in Django. Any existings PIL scripts can be added very easily. Let me know if you want to contribute

Re: PIL transparency gradient

2008-03-01 Thread Allard Warrink
Thanks for the inspiration! This what I did (Using your Python Editor (SPE), I really like to work with SPE, keep up the good work!!): # import Image, os p = # path to image file im = Image.open(p) # check if im has Alpha band... if im.mode != 'RGBA':

Re: using PIL for PCA analysis

2008-02-26 Thread harryos
Paul McGuire wrote # following approx fromhttp://www.dfanning.com/ip_tips/color2gray.html grayscale = lambda (R,G,B) : int(0.3*R + 0.59*G + 0.11*B) print [ [ grayscale(rgb) for rgb in row ] for row in sampledata ] Paul in PIL handbook ,they mention a Luma transform on page15, under

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-25 Thread SPE - Stani's Python Editor
On 22 feb, 15:36, Mike Driscoll [EMAIL PROTECTED] wrote: On Feb 22, 1:41 am, Mike Driscoll [EMAIL PROTECTED] wrote: I'm confused. What needs to be compiled exactly? Are there any directions? I'm not seeing any at that website. I can give it a go if someone can give me advice. You

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-25 Thread Mike Driscoll
Hi, I have Visual Studio 6 and .NET 2003 so I think I'm good for that. I am not sure you even need it. I found here some more instructions for another project which uses libexiv2, which seems to be quite straightforward:http://albumshaper.wiki.sourceforge.net/Compiling+on+Windows I hope

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-24 Thread Daniel Fetchinson
at manipulating individual pictures (such as with Gimp), but repeating the same actions on hundreds or thousands of images. If you know PIL and have some nice recipes laying around, it is very easy to write plugins as Phatch generates the corresponding GUI automagically just like in Django. Any existings

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread SPE - Stani's Python Editor
On Feb 22, 1:41 am, Mike Driscoll [EMAIL PROTECTED] wrote: On Feb 20, 4:19 am, Stani [EMAIL PROTECTED] wrote: Even without python-pyexiv2 Phatch features read-only EXIF support thanks to PIL. So you can name your files or write data stamps (date, aperature, velocity, ...) based on EXIF

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread SPE - Stani's Python Editor
://translations.launchpad.net/phatch/trunk/+pots/phatch - at the moment Phatch has no known bugs, I really wish someone could fine one so I can fix it: https://bugs.launchpad.net/phatch/ I hope a lot of people give this program a try as it only requires you to set up wxPython and PIL. Stani -- http

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread Steve Holden
just reported a Windows font issue. I hope a lot of people give this program a try as it only requires you to set up wxPython and PIL. I also blogged about it http://holdenweb.blogspot.com/2008/02/phatch-photo-batch-processor.html so my reader may take a look :) regards Steve -- Steve

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread Mike Driscoll
On Feb 22, 2:39 am, SPE - Stani's Python Editor [EMAIL PROTECTED] wrote: On Feb 22, 1:41 am, Mike Driscoll [EMAIL PROTECTED] wrote: On Feb 20, 4:19 am, Stani [EMAIL PROTECTED] wrote: Even without python-pyexiv2 Phatch features read-only EXIF support thanks to PIL. So you can name

Re: using PIL for PCA analysis

2008-02-21 Thread Matthieu Brucher
by images * transpose(images) my problem is how i can use PIL to do the same thing..if i extract imagedata using im.getdata() i will get sampledata [ [(188, 169, 155), (96, 85, 81),.. (176, 162, 153)] [(173, 154, 148), (112, 101, 97),.. (155, 140, 133)] [(196, 176, 167), (100, 83, 76

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-21 Thread Istvan Albert
On Feb 18, 9:58 am, SPE - Stani's Python Editor [EMAIL PROTECTED] wrote: I'm pleased to announce the release of Phatch which is a powerful batch processor and renamer. Phatch exposes a big part of This program is fantastic! Very accesible user interface and produces ggreat images. Thanks!

RE: using PIL for PCA analysis

2008-02-21 Thread Bronner, Gregory
Since nobody has responded to this: I know nothing about PIL, but you can do this using numpy and scipy fairly easily, and you can transform PIL arrays into Numpy arrays pretty quickly as well. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday

Re: using PIL for PCA analysis

2008-02-21 Thread [EMAIL PROTECTED]
On Feb 21, 7:35 pm, Bronner, Gregory [EMAIL PROTECTED] wrote: you can do this using numpy and scipy fairly easily, and you can transform PIL arrays into Numpy arrays pretty quickly as well. i can use numpy ndarray or matrix once i have a PIL array with elements in the correct format(ie

Re: using PIL for PCA analysis

2008-02-21 Thread Paul McGuire
] [-5597295.0, -7901339.0,... -5989995.0] ] /sampledata i can normalise the above matrix to zeromean and then find covariance matrix by images * transpose(images) my problem is how i can use PIL to do the same thing..if i extract imagedata using im.getdata() i will get sampledata

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-21 Thread Mike Driscoll
the executable, not the library. Even without python-pyexiv2 Phatch features read-only EXIF support thanks to PIL. So you can name your files or write data stamps (date, aperature, velocity, ...) based on EXIF information. If you want to save EXIF and IPTC information to files you need python

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-20 Thread Stani
On Feb 19, 1:19 pm, Steve Holden [EMAIL PROTECTED] wrote: Perhaps you could put a link to the source on the Windows instalL page? I don't mind being a second-class citizen, but it's annoying to have to jump around like that. It is an open wiki, but I changed it. I am a bit reluctant as the

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-20 Thread Stani
free to translate the other one) Thans to Frédéric, there is now a tutorial for writing your own actions with PIL (no knowledge of wxpython needed): http://photobatch.wikidot.com/writing-actions Also to understand fully how variables work in Phatch for filenames and folders: http

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-20 Thread Stani
-pyexiv2 Phatch features read-only EXIF support thanks to PIL. So you can name your files or write data stamps (date, aperature, velocity, ...) based on EXIF information. If you want to save EXIF and IPTC information to files you need python-pyexiv2. From its website: However, the library and all

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-20 Thread Fred Pacquier
Stani [EMAIL PROTECTED] said : Even without python-pyexiv2 Phatch features read-only EXIF support thanks to PIL. So you can name your files or write data stamps (date, aperature, velocity, ...) based on EXIF information. Oh, that's good. I hadn't looked at PIL for a long while and wasn't

using PIL for PCA analysis

2008-02-20 Thread [EMAIL PROTECTED]
matrix to zeromean and then find covariance matrix by images * transpose(images) my problem is how i can use PIL to do the same thing..if i extract imagedata using im.getdata() i will get sampledata [ [(188, 169, 155), (96, 85, 81),.. (176, 162, 153)] [(173, 154, 148), (112, 101, 97),.. (155, 140

Re: average of PIL images

2008-02-19 Thread vaneric
def rgbTopixelvalue((r,g,b)): alpha=255 return unpack(l, pack(, b, g, r, alpha))[0] That's much worse than averaging the R,G,B components. oops! the intention was to pack r,g,b components into a single value sothat calculations like finding covariant matrix of a set of images

Re: average of PIL images

2008-02-19 Thread 7stud
On Feb 19, 12:13 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Tue, 19 Feb 2008 04:01:04 -0200, vaneric [EMAIL PROTECTED]   escribió: On Feb 19, 1:38 am, Robert Kern [EMAIL PROTECTED] wrote: Averaging color images is tricky; you really shouldn't do it in the RGB colorspace. hi,

Re: average of PIL images

2008-02-19 Thread Gabriel Genellina
On 19 feb, 06:28, vaneric [EMAIL PROTECTED] wrote: def rgbTopixelvalue((r,g,b)):    alpha=255    return unpack(l, pack(, b, g, r, alpha))[0] That's much worse than averaging the R,G,B components. oops! the intention was to pack r,g,b components into a single value sothat

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread SPE - Stani's Python Editor
an user friendly GUI. (It is using python-pyexiv2 to offer more extensive EXIF and IPTC support.) Phatch is not targeted at manipulating individual pictures (such as with Gimp), but repeating the same actions on hundreds or thousands of images. If you know PIL and have some nice recipes

Re: average of PIL images

2008-02-19 Thread Gabriel Genellina
On 19 feb, 06:55, 7stud [EMAIL PROTECTED] wrote: On Feb 19, 12:13 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Tue, 19 Feb 2008 04:01:04 -0200, vaneric [EMAIL PROTECTED]   escribió: On Feb 19, 1:38 am, Robert Kern [EMAIL PROTECTED] wrote: Averaging color images is tricky; you

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Steve Holden
SPE - Stani's Python Editor wrote: I'm pleased to announce the release of Phatch which is a powerful batch processor and renamer. Phatch exposes a big part of the Python Imaging Library through an user friendly GUI. (It is using python-pyexiv2 to offer more extensive EXIF and IPTC support.)

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Fred Pacquier
Steve Holden [EMAIL PROTECTED] said : Perhaps you could put a link to the source on the Windows instalL page? I don't mind being a second-class citizen, but it's annoying to have to jump around like that. I'm interested too, and was also wondering if Phatch is as full-featured unders

Re: average of PIL images

2008-02-19 Thread vaneric
a) Work with the 3 components in parallel (that is, use 3 separate matrices, one for each component, and regenerate the image at the end). that wd be ok for image generation ..but to calculate covariance matrix from the set of images i don't know if it wd work eric --

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Daniel Fetchinson
at manipulating individual pictures (such as with Gimp), but repeating the same actions on hundreds or thousands of images. If you know PIL and have some nice recipes laying around, it is very easy to write plugins as Phatch generates the corresponding GUI automagically just like

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Wolfgang Strobl
are welcome. Requirements: - PIL 1.1.5 or higher - wxPython 2.6 or higher - pyexiv2 (optional) - python nautilus bindings (optional) Hm. I just gave it a try on Windows, but in vain. See below. C:\build\phatch-0.1.bzr385python setup.py install just says Sorry your platform is not yet supported. from

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Steve Holden
. Packagers for other platforms are welcome. Requirements: - PIL 1.1.5 or higher - wxPython 2.6 or higher - pyexiv2 (optional) - python nautilus bindings (optional) Hm. I just gave it a try on Windows, but in vain. See below. C:\build\phatch-0.1.bzr385python setup.py install just says Sorry

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Wolfgang Strobl
Steve Holden [EMAIL PROTECTED] wrote: RTFM: the web site instructions clearly state that setup.py doesn't currently work with Windows. Do they? http://photobatch.stani.be/ doesn't, following documentation http://photobatch.stani.be/ doesn't, either. I missed start phatch in trunk/phatch while

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Steve Holden
Wolfgang Strobl wrote: Steve Holden [EMAIL PROTECTED] wrote: RTFM: the web site instructions clearly state that setup.py doesn't currently work with Windows. Do they? http://photobatch.stani.be/ doesn't, following documentation http://photobatch.stani.be/ doesn't, either. I missed

ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-18 Thread SPE - Stani's Python Editor
individual pictures (such as with Gimp), but repeating the same actions on hundreds or thousands of images. If you know PIL and have some nice recipes laying around, it is very easy to write plugins as Phatch generates the corresponding GUI automagically just like in Django. Any existings PIL scripts

average of PIL images

2008-02-18 Thread vaneric
image and display it.problem is i need to calculate (xa1+xb1+xc1)/3 etc to calculate avearge value of each pixel.how can i do this calculation.do i need to convert the r,g,b in to a single value for each pixel? the average value of a pixel will be a float isn't it? how can i create a PIL image from

Re: average of PIL images

2008-02-18 Thread Robert Kern
of colorspaces which you could choose; different problems require different colorspaces. the average value of a pixel will be a float isn't it? Yes. how can i create a PIL image from this? # Cast the floating point data to bytes. avgface = avgface.astype(numpy.uint8) # Create the PIL image

Re: average of PIL images

2008-02-18 Thread 7stud
of a pixel will be a float isn't it? how can i create a PIL image from this? any help,directive greatly appreciated eric import Numeric arr = Numeric.array([ [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12] ]) col1 = arr[0:,0] print col1 sum = 0 count = 0 for num in col1: sum

Re: average of PIL images

2008-02-18 Thread 7stud
the r,g,b in to a single value for each pixel? the average value of a pixel will be a float isn't it? how can i create a PIL image from this? any help,directive greatly appreciated eric import Numeric arr = Numeric.array([     [1, 2, 3],     [4, 5, 6],     [7, 8, 9],     [10, 11, 12

Re: average of PIL images

2008-02-18 Thread 7stud
On Feb 18, 2:05 pm, 7stud [EMAIL PROTECTED] wrote: num = arr[1:, 2:] That says to get all elements from row 1 to the bottom that are in from column 2 to the end of the row. err.. That says to get all elements from row 1 to the last row which are in column 2, column 3, etc. to the end of the

Re: average of PIL images

2008-02-18 Thread Larry Bates
can i create a PIL image from this? any help,directive greatly appreciated eric Take a look at ImageChops.difference. I've used it to calculate a difference value as follows: diff=ImageChops.difference(im1, im2) totaldiff=sum(ImageStat.Stat(diff)._getmedian()) Maybe at least this will point

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-18 Thread Daniel Fetchinson
extensive EXIF and IPTC support.) Phatch is not targeted at manipulating individual pictures (such as with Gimp), but repeating the same actions on hundreds or thousands of images. If you know PIL and have some nice recipes laying around, it is very easy to write plugins as Phatch generates

Re: average of PIL images

2008-02-18 Thread vaneric
image avgface = avgface.astype(numpy.uint8) img = Image.fromstring('L', (width, height), avgface.tostring()) is there something wrong with my approach? I am a newbie in PIL/ imageprocessing ..so i would greately appreciate feedback eric -- http://mail.python.org/mailman/listinfo/python-list

Re: average of PIL images

2008-02-18 Thread vaneric
can't convert to greyscale) is there something wrong with my approach? I am a newbie in PIL/ imageprocessing ..so i would greately appreciate feedback eric -- http://mail.python.org/mailman/listinfo/python-list

Re: average of PIL images

2008-02-18 Thread Gabriel Genellina
En Tue, 19 Feb 2008 04:01:04 -0200, vaneric [EMAIL PROTECTED] escribió: On Feb 19, 1:38 am, Robert Kern [EMAIL PROTECTED] wrote: Averaging color images is tricky; you really shouldn't do it in the RGB colorspace. hi, thanx for the guidance and detailed replies..I tried to pack the

Easy PIL question

2008-02-16 Thread Adam W.
I know there is an easy way to do this, but I can't figure it out, how do I get the color of a pixel? I used the ImageGrab method and I want to get the color of a specific pixel in that image. If you know how to make it only grab that pixel, that would also be helpful. Basically I'm trying to

Re: Easy PIL question

2008-02-16 Thread Gary Herron
Adam W. wrote: I know there is an easy way to do this, but I can't figure it out, how do I get the color of a pixel? I used the ImageGrab method and I want to get the color of a specific pixel in that image. If you know how to make it only grab that pixel, that would also be helpful.

Re: Easy PIL question

2008-02-16 Thread bearophileHUGS
Gary Herron: Try image.getpixel((x,y)) to retrieve the pixel at (x,y). If the OP needs to access many pixels, then he can use the load() method on the image object, and then read/write pixels (tuples of 3 ints) using getitem [] import Image im = Image img = im.load() img[x,y] = ... ... =

PIL linux err

2008-01-31 Thread dzizes
Hi, I'm trying to run simple .py on linux, which is using PIL. Below error message which I receive: File /usr/lib/python2.4/site-packages/PIL/Image.py, line 960, in histogram self.load() File /usr/lib/python2.4/site-packages/PIL/ImageFile.py, line 180, in load d = Image._getdecoder

Re: PIL linux err

2008-01-31 Thread John Machin
On Feb 1, 5:41 am, dzizes [EMAIL PROTECTED] wrote: Hi, I'm trying to run simple .py on linux, which is using PIL. Below error message which I receive: File /usr/lib/python2.4/site-packages/PIL/Image.py, line 960, in histogram self.load() File /usr/lib/python2.4/site-packages/PIL

Re: PIL linux err

2008-01-31 Thread Paul McNett
dzizes wrote: I'm trying to run simple .py on linux, which is using PIL. Below error message which I receive: IOError: decoder jpeg not available Do you know what might be the problem? No, but google seems to: http://effbot.org/zone/pil-decoder-jpeg-not-available.htm Paul -- http

Re: *SPAM*: 06.2/6.0 - Re: Manually installing PIL

2008-01-13 Thread j igisbert.etra-id
Dear Fredik, I have tried to copy PIL folder into my application folder. I am using Tkinter also, and when I want to put an image as label I do: photo1 = Image.open(rMyimage.gif) photo = ImageTk.PhotoImage(photo1) llogo =Label(root, image=photo,bg=white,height=60) And I receive

Re: Manually installing PIL

2008-01-13 Thread Fredrik Lundh
j igisbert.etra-id wrote: this. I have download Imaging-1.1.6 source code, and I found PIL folder, but not binary file. If I download windows exe installer, it works great, but I want to install manually for installing it on my PDA as the name implies, the source code distribution

Re: *SPAM*: 04.6/4.0 - Re: Manually installing PIL

2008-01-13 Thread j igisbert.etra-id
: Manually installing PIL j igisbert.etra-id wrote: this. I have download Imaging-1.1.6 source code, and I found PIL folder, but not binary file. If I download windows exe installer, it works great, but I want to install manually for installing it on my PDA as the name implies, the source code

help for installing PIL

2008-01-11 Thread Chan Kuang Lim
I'm using Window XP. How to install PIL 1.1.6? The Python i installed, is come with Plone. So, is it ok? Thank you. Regards, Chan Kuang Lim - Looking for last minute shopping deals? Find them fast with Yahoo! Search.-- http://mail.python.org/mailman

Re: help for installing PIL

2008-01-11 Thread Fredrik Lundh
Chan Kuang Lim wrote: I'm using Window XP. How to install PIL 1.1.6? The Python i installed, is come with Plone. So, is it ok? Thank you. Just run the appropriate installer for your Python version: http://www.pythonware.com/products/pil as the page says, If the Windows installer cannot

PIL rotate : Rotate By Shear / Paeth Rotation?

2008-01-10 Thread IanJSparks
I've been doing some image rotation with PIL and comparing the images with imagemagick's convert -rotate output. Imagemagick uses an RBS / Paeth rotation algorithm that appears to give better results than PIL's rotate method. However, I love PIL and don't want to have to shell out to imagemagick

PIL question

2008-01-09 Thread Alex K
Hello, Would anyone know how to generate thumbnails with rounded corners using PIL? I'm also considering imagemagick if PIL turns out not to be appropriate for the task. Thank you so much, Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL question

2008-01-09 Thread Fredrik Lundh
Alex K wrote: Would anyone know how to generate thumbnails with rounded corners using PIL? I'm also considering imagemagick if PIL turns out not to be appropriate for the task. create a mask image with round corners (either with your favourite image editor or using ImageDraw/aggdraw or some

Re: PIL question

2008-01-09 Thread Fredrik Lundh
Fredrik Lundh wrote: create a mask image with round corners (either with your favourite image editor or using ImageDraw/aggdraw or some such). and for people stumbling upon via a search engine some time in the future, Stani just posted a complete example over at the image-sig mailing list.

Does PIL work with Tk 8.5?

2008-01-07 Thread Kevin Walzer
I'm using a build of Python 2.5.1 on OS X 10.5.1 that links to Tk 8.5. Trying to test PIL with this new build, Python barfs when trying to display an image in a Tkinter Label. Here is my sample code: --- from Tkinter import * import Image, ImageTk root = Tk() im = Image.open('/Users/kevin

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Martin v. Löwis
of changes which break Tkinter applications (though not Tkinter itself). OTOH, it's more likely that the PIL binaries you are using conflict with your Tk installation - if the binaries were for Tk 8.4 (which isn't quite clear to me whether that's indeed the case), then they can't work with Tk 8.5

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Kevin Walzer
Martin v. Löwis wrote: OTOH, it's more likely that the PIL binaries you are using conflict with your Tk installation - if the binaries were for Tk 8.4 (which isn't quite clear to me whether that's indeed the case), then they can't work with Tk 8.5, as Tk doesn't provide that kind of binary

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Kevin Walzer
to be used with 8.5. Since PIL is a Python library, however, you may be right. Indeed, this appears to be the problem. I tested my script against the Python bundled with Mac OS X, which links against 8.4, and it worked fine. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http

Re: Does PIL work with Tk 8.5?

2008-01-07 Thread Martin v. Löwis
Tk itself has a stubs mechanism that allows libraries compiled against earlier versions to be used with later versions. It's different than Python in this respect. A pure-Tk library (such as Img or TkPNG) built against Tk 8.4 would not require re-compilation to be used with 8.5. Since PIL

Re: Manually installing PIL

2008-01-03 Thread Fredrik Lundh
Jose Ignacio Gisbert wrote: Does somebody install PIL manually??, I mean, copy directories manually without executing setup.py. I saw an identical message from Guirai, but I didn’t see any response. Thanks in advance! PIL's just a bunch of modules in a single PIL directory; you can put

Re: PyCairo, PIL and StringIO

2008-01-02 Thread Fredrik Lundh
Jair Trejo wrote: I'm doing some image processing in PIL, and I want to display the results in a GTK window using PyCairo, so I create a Cairo image surface from the PIL Image like this: data mfile = StringIO.StringIO() final.save(mfile, format=PNG) ima

Re: Re: PyCairo, PIL and StringIO

2008-01-02 Thread Jair Trejo
De: Fredrik Lundh [EMAIL PROTECTED] A: python-list@python.org Fecha: Wed, 02 Jan 2008 15:39:11 +0100 Asunto: Re: PyCairo, PIL and StringIO Jair Trejo wrote: I'm doing some image processing in PIL, and I want to display the results in a GTK window using PyCairo, so I create

Manually installing PIL

2008-01-02 Thread Jose Ignacio Gisbert
Hello All, Does somebody install PIL manually??, I mean, copy directories manually without executing setup.py. I saw an identical message from Guirai, but I didn't see any response. Thanks in advance! Best Regards, Naxo -- http://mail.python.org/mailman/listinfo/python-list

PyCairo, PIL and StringIO

2008-01-01 Thread Jair Trejo
I'm doing some image processing in PIL, and I want to display the results in a GTK window using PyCairo, so I create a Cairo image surface from the PIL Image like this: mfile = StringIO.StringIO() final.save(mfile, format=PNG) ima = cairo.ImageSurface.create_from_png(mfile

ImageTk.PhotoImage to PIL Image?

2007-12-02 Thread shadowsithe
I can't seem to find a way to convert an Image.Tk PhotoImage to a PIL Image so that I can use the [tt]save[/tt] function. -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL + show() + Vista

2007-11-30 Thread M�ta-MCI (MVP)
Hi! Sorry, I don't understand english. But, with Babelfish-translation, I recovered essence... (you should learn French ; yes! yes! yes!) I'm glad you found a solution Thank you for your solicitude if that executable doesn't honour the wait I have just try on another CPU, with a very

Re: PIL + show() + Vista

2007-11-30 Thread Tim Golden
Méta-MCI (MVP) wrote: Hi, Tim! You are right, for shimgvw.dll (on XP / 2000, or some Vista). But others Vista (ou users practice) had associate images with WindowsPhotoGallery.exe. But shimgvw.dll already exist. I found that this line: command = 'start %s /wait

Re: PIL + show() + Vista

2007-11-30 Thread M�ta-MCI (MVP)
Hi, Tim! You are right, for shimgvw.dll (on XP / 2000, or some Vista). But others Vista (ou users practice) had associate images with WindowsPhotoGallery.exe. But shimgvw.dll already exist. I found that this line: command = 'start %s /wait %s\\System32\\rundll32.exe

Re: PIL + show() + Vista

2007-11-30 Thread Tim Golden
Méta-MCI (MVP) wrote: Re! I have found the problem. On Vista, the Windows-Photo-Galery (soft default displayer) don't wait. Even with START /WAIT (in Image.py _showxv), it don't wait. Then, like the preview don't wait, the (next) DEL run prior the end of the launch of the software

Re: PIL + show() + Vista

2007-11-30 Thread M�ta-MCI (MVP)
Re! I have found the problem. On Vista, the Windows-Photo-Galery (soft default displayer) don't wait. Even with START /WAIT (in Image.py _showxv), it don't wait. Then, like the preview don't wait, the (next) DEL run prior the end of the launch of the software ; and Windows-Photo-Galery

Re: PIL + show() + Vista

2007-11-30 Thread M�ta-MCI (MVP)
Hi! Not a true solution ; because people who don't have IrfanView don't use it. @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL + show() + Vista

2007-11-30 Thread Tim Golden
Méta-MCI (MVP) wrote: [Excuse my execrable French below] Sorry, I don't understand english. But, with Babelfish-translation, I recovered essence... (you should learn French ; yes! yes! yes!) Vraiment! I have just try on another CPU, with a very new Vista-premium (configuration of exit

Re: PIL + show() + Vista

2007-11-30 Thread M�ta-MCI (MVP)
Re! I have found a (very) poor solution: in Image.py, inside _showxv function, replace command = start /wait %s del /f %s % (file, file) by command = 'start %s /wait %s\\System32\\mshta.exe %s del /f %s ' % (title,os.environ['WINDIR'],file,file) For zoom in preview, use

PIL image.getcolors

2007-11-29 Thread Robin Becker
I have an RGBA .png which PIL is able to read and I would like to convert the image to a simple RGB image with a single colour reserved for transparent as the A channel is either all on or all off. I thought I could use the the im.getcolors method to find the colours used by the image

PIL image.filter - boundaries

2007-11-29 Thread [EMAIL PROTECTED]
Hi, I'm filtering an image with a custom kernel. It works fine, except for the boundaries. image.filter() seems to add a 1px zero-border to the image to process the pixels at the boundaries of the image.I'd rather have it replicate the values of the boundary pixels. Is this an option and where

PIL + show() + Vista

2007-11-29 Thread M�ta-MCI (MVP)
Hi! This code: import Image img = Image.open(rD:\ParisNude.jpg) img.show() Don't run on my Vista computer. I have a solution: import Image,os img = Image.open(rD:\FLundhNoNude.jpg) os.startfile(img.filename) It's only in my case? It's censure? ;-) PIL does

Re: PIL + show() + Vista

2007-11-29 Thread Cousin Stanley
This code: import Image img = Image.open(rD:\ParisNude.jpg) img.show() Don't run on my Vista computer. I have a solution: import Image,os img = Image.open(rD:\FLundhNoNude.jpg) os.startfile(img.filename) Michel As an alternative you might also try

Re: creating color gradients using PIL

2007-11-23 Thread Simon Hibbs
for building PIL images from numpy arrays # Convert a 2-d array with typecode 'b' to an image with mode 'P' def numpy2pil(arr): rows = arr.shape[0] cols = arr.shape[1] m = arr.tostring() out = Image.new('L', (cols, rows), 999 ) #out.fromstring(m

png transparency with PIL

2007-11-23 Thread Robin Becker
I'm trying to determine the transparency information for a png image. With gif images I can determine the colour that is used for transparent areas using im.info['transparency']. For the png images of interest there is no such entry in the info dict. I assume that's because of the way png does

Re: png transparency with PIL

2007-11-23 Thread Bjoern Schliessmann
because of the way png does transparency. I'm guessing I need the alpha channel, but is there a way to get hold of it? For accessing the alpha channel, there is an RGBA mode for PNG files: http://www.pythonware.com/library/pil/handbook/format-png.htm Regards, Björn -- BOFH excuse #58: high

Re: png transparency with PIL

2007-11-23 Thread Robin Becker
://www.pythonware.com/library/pil/handbook/format-png.htm ... that sounds like what I need. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

creating color gradients using PIL

2007-11-20 Thread Ramdas
Any ideas how we can create a color gradient using Python Imaging Library. Has any got some sample code that can give me some idea. I need to create a horizontal and vertical color gradient for a college project Thanks -- http://mail.python.org/mailman/listinfo/python-list

PIL question

2007-11-16 Thread Thomas Heller
I'm trying to read an image with PIL, crop several subimages out of it, and try to combine the subimages again into a combined new one. This is a test script, later I want to only several single images into a combined one. I have to work with 16-bit color windows bitmaps in BMP format. My input

Re: PIL question

2007-11-16 Thread Thomas Heller
Thomas Heller schrieb: I'm trying to read an image with PIL, crop several subimages out of it, and try to combine the subimages again into a combined new one. This is a test script, later I want to only several single images into a combined one. [...] Here is the code; I'm using Python 2.4

Re: What colour model does the image use in PIL

2007-11-07 Thread Hrvoje Niksic
Johny [EMAIL PROTECTED] writes: I would need to apply a threshold value to the image, where everything above a certain brightness level becomes white, and everything below the level becomes black. How can I do that with PIL? I think you're supposed to use the point method, but I don't have

Re: What colour model does the image use in PIL

2007-11-07 Thread Hrvoje Niksic
Johny [EMAIL PROTECTED] writes: I use PIL and with it im.getpixel((x,y)) to find out the colour of a pixel. But how can I find out in which color model the the return value is? im.mode gives you a string such as 'RGBA' or 'CMYK'. im.getbands() returns a tuple such as ('R', 'G', 'B

What colour model does the image use in PIL

2007-11-07 Thread Johny
I use PIL and with it im.getpixel((x,y)) to find out the colour of a pixel. But how can I find out in which color model the the return value is? For example for png picture format im.getpixel((20,50)) gives the result 60. What does the value mean? Is it possible to find out the RGB model

Re: What colour model does the image use in PIL

2007-11-07 Thread Johny
On Nov 7, 2:53 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Johny [EMAIL PROTECTED] writes: I use PIL and with it im.getpixel((x,y)) to find out the colour of a pixel. But how can I find out in which color model the the return value is? im.mode gives you a string such as 'RGBA' or 'CMYK

PIL Problem

2007-11-07 Thread tonylabarbara
Hi; I´ve installed Zope 2.10.5 on top of Python 2.4.2 (not optimal, but it will work, according to the build instructions). I installed Plone 3.0.2 and I get errors when I crank up Zope, all related to a non-existent PIL. So I d/l/d the latest PIL, plopped it in my Extensions dir, ran

PIL and getpixel()

2007-10-16 Thread [EMAIL PROTECTED]
i am trying to get the pixel data using im.getpixel() i am getting a tuple like (152,118,106) for a pixel in a RGB jpeg image . what i really want is an integer value representing a pixel ,like waht i can get from java's BufferedImage.getRGB(x,y) .. i am wondering if someone can advise me on how

Re: PIL and getpixel()

2007-10-16 Thread Marc 'BlackJack' Rintsch
On Tue, 16 Oct 2007 07:05:56 +, [EMAIL PROTECTED] wrote: i am trying to get the pixel data using im.getpixel() i am getting a tuple like (152,118,106) for a pixel in a RGB jpeg image . what i really want is an integer value representing a pixel ,like waht i can get from java's

Re: PIL and getpixel()

2007-10-16 Thread [EMAIL PROTECTED]
Just pack the RGB values into an `int` by shifting and or-ing. Untested: red, green, blue = img.getpixel(x, y) pixel_as_int = red 16 | green 8 | blue Ciao, Marc 'BlackJack' Rintsch thanx Marc will try that dn -- http://mail.python.org/mailman/listinfo/python-list

Re: Pil image module, mode bug..

2007-10-08 Thread [EMAIL PROTECTED]
On Oct 7, 8:17 pm, Michal Bozon [EMAIL PROTECTED] wrote: On Sun, 07 Oct 2007 09:02:09 -0700, Abandoned wrote: On Oct 7, 4:47 pm, Michal Bozon [EMAIL PROTECTED] wrote: On Sun, 07 Oct 2007 06:03:06 -0700, Abandoned wrote: Hi.. I find the picture color with: im=Image.open(/%s %name)

Re: Pil image module, mode bug..

2007-10-08 Thread Diez B. Roggisch
of that? are there anybody who know that Who knows what? That PIL has e.g. a histogram-function that delivers what you need (after some thinking, I suggest you try and see at it's output with various source images) Diez -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >