From quimico69@yahoo.com Mon Oct 7 00:02:06 2002 From: quimico69@yahoo.com (Victor Manuel Rosas-García) Date: Sun, 6 Oct 2002 16:02:06 -0700 (PDT) Subject: [Image-SIG] how to make transparent background? Message-ID: <20021006230206.47913.qmail@web10505.mail.yahoo.com> Hello everybody, I'm pretty new to image processing and I've been programming with Python and PIL for a couple of weeks. Let's say that I have an image on black background created using the following: Python 2.2.1 (#1, Sep 25 2002, 11:42:45) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-110)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> import ImageDraw >>> im = Image.new('RGBA', (400,400), 0) >>> d = ImageDraw.ImageDraw(im) >>> d.rectangle((100,100,300,300), fill=255) now I have a red square surrounded by black background. How can I make the background transparent? I'm using PIL 1.1.3 ===== Victor M. Rosas García Theoretical Chemistry Apprentice e-mail: quimico69@yahoo.com __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com From Chris.Barker@noaa.gov Tue Oct 8 00:42:26 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 7 Oct 2002 16:42:26 -0700 Subject: [Image-SIG] compiling PIL on OS-X.2: Jaguar Message-ID: <6F26185A-DA4E-11D6-AFBE-000393A96660@noaa.gov> Hi all, I'm trying to compile PIL on OS-X 10.2.1, to work with the version of Python2.2 that it shipped with (the straight Unix build) I downloaded the tarball for Imaging-1.1.3, unpacked it, and tried the basic: $ cd Imaging-1.1.3/libImaging $ ./configure $ make $ cd .. $ python setup.py build What I got what a bunch of messages like: ld: warning build/temp.darwin-6.1-Power Macintosh-2.2/_imaging.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) why would there be an "-arch flag:i386" there??? I also got errors about libjpeg not being there, so i downloaded jpegsrc.V6b.tar.gz, unpacked and compiled that. It seemed to work fine of I did a staight ./configure, make, make install, but if I tried ./configure --enable-shared --enable-static, but that didn't seem to work well. In any case, with the standard build I got a libjpeg.a file, is that what I need? Any hint would help, I really would like to get this working. BTW, I have no need, at the moment, for the TK stuff, which I imagine would be a whole other ball of wax to get working. thanks, -Chris From SamuelM.Smith Tue Oct 8 01:03:11 2002 From: SamuelM.Smith (SamuelM.Smith) Date: Mon, 7 Oct 2002 18:03:11 -0600 Subject: [Image-SIG] Re: [Pythonmac-SIG] compiling PIL on OS-X.2: Jaguar In-Reply-To: <6F26185A-DA4E-11D6-AFBE-000393A96660@noaa.gov> Message-ID: <55ABAE90-DA51-11D6-8EAA-00039346A274@samuelsmith.org> On Monday, October 7, 2002, at 05:42 PM, Chris Barker wrote: > Hi all, > > I'm trying to compile PIL on OS-X 10.2.1, to work with the version of > Python2.2 that it shipped with (the straight Unix build) > The fink version of unix python and pil built fine for me on Jaguar. I now have the python that came with Jaguar and also the Fink version of python installed on my system. All the TK stuff installed as part of the fink build of unix python. From Chris.Barker@noaa.gov Tue Oct 8 19:22:28 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Tue, 8 Oct 2002 11:22:28 -0700 Subject: [Image-SIG] Re: [Pythonmac-SIG] compiling PIL on OS-X.2: Jaguar In-Reply-To: <30967722-DA89-11D6-8F80-0003935458F6@epoz.org> Message-ID: On Monday, October 7, 2002, at 11:43 PM, Etienne Posthumus wrote: > At this moment no-one knows why. Rest assured that you are not the > only one seeing those weird error messages, and that other modules are > also affected by it. > You can try removing the offending flag from > /usr/lib/python2.2/config/Makefile I can't explain why, but I kind of wanted to get it working with the default Python, so i took the : "-arch i386" out of the Make file, and PIL now seems to build just fine, except I still don't seem to have jpeg support (which I'll need some day, but not now) > Let's hope that there is an Apple provided software update to Python > with a newer version including all the goodness done by the Pythonmac > people. Yes, let's hope. Or even better, does anyone know who we can lobby to get an official Apple update to fix a few of these things in Python. It's silly, but it really makes it easier for me to use Python at work if Apple is providing it! It gives it an air of legitimacy. Thanks for all you help. Now on to readline! -Chris From denis.fan@dcs.warwick.ac.uk Tue Oct 15 14:22:25 2002 From: denis.fan@dcs.warwick.ac.uk (Denis Fan) Date: Tue, 15 Oct 2002 14:22:25 +0100 Subject: [Image-SIG] Bus Error Message-ID: <3DAC1691.36168B17@dcs.warwick.ac.uk> I have installed Python Imaging Library into my sun's work station. To make sure that PIL is working properly, I have run the "test.py" within the package and seems to get all the tests right. I can also imported Image and ImageTk successfully in Python, but when I tried to do the task below, problem came: im = Image.open(photo.gif) photo = ImageTk.PhotoImage(im) ----> in the process of creating photo ... Bus Error (core dumped) appear .... even though I tried im = Image.open(photo.gif) tkim = ImageTk.PhotoImage(im.mode, im.size) tkim.paste(ImageEnhance.Contrast(im).enhance(2.67)) ----> in the process ... Bus Error (core dumped) appear .... why? Did I do something wrong with the installation? Denis -- From fredrik@pythonware.com Wed Oct 16 08:24:12 2002 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 16 Oct 2002 09:24:12 +0200 Subject: [Image-SIG] Bus Error References: <3DAC1691.36168B17@dcs.warwick.ac.uk> Message-ID: <009401c274e5$07d5f370$0900a8c0@spiff> denis wrote: > I have installed Python Imaging Library into my sun's work station. To > make sure that PIL is working properly, I have run the "test.py" > within the package and seems to get all the tests right. >=20 > I can also imported Image and ImageTk successfully in Python, but when = I > tried to do the task below, problem came: >=20 > im =3D Image.open(photo.gif) > photo =3D ImageTk.PhotoImage(im) > ----> in the process of creating photo ... Bus Error (core dumped) > appear .... >=20 > even though I tried > im =3D Image.open(photo.gif) > tkim =3D ImageTk.PhotoImage(im.mode, im.size) > tkim.paste(ImageEnhance.Contrast(im).enhance(2.67)) > ----> in the process ... Bus Error (core dumped) appear .... >=20 > why? Did I do something wrong with the installation? what Tk version are you using? do you get a stack trace if you run this under a debugger? From denis.fan@dcs.warwick.ac.uk Wed Oct 16 12:28:44 2002 From: denis.fan@dcs.warwick.ac.uk (Denis Fan) Date: Wed, 16 Oct 2002 12:28:44 +0100 Subject: [Image-SIG] Bus Error Message-ID: <3DAD4D6C.85B84376@dcs.warwick.ac.uk> Fredrik Lundh wrote: > I can also imported Image and ImageTk successfully in Python, but when I > tried to do the task below, problem came: > > im = Image.open(photo.gif) > photo = ImageTk.PhotoImage(im) > ----> in the process of creating photo ... Bus Error (core dumped) > appear .... > > even though I tried > im = Image.open(photo.gif) > tkim = ImageTk.PhotoImage(im.mode, im.size) > tkim.paste(ImageEnhance.Contrast(im).enhance(2.67)) > ----> in the process ... Bus Error (core dumped) appear .... > > why? Did I do something wrong with the installation? what Tk version are you using? do you get a stack trace if you run this under a debugger? The Tk and Tcl are in version 8.2, is that why? or should I need to install a newer version of TK? I have looked at some tutorial on the web, which teach you how to use the debugger, but I am still not fully understand the main concept of how does it work, has anyone got any link or docs that can help? Thanks -d -- From denis.fan@dcs.warwick.ac.uk Wed Oct 16 12:25:15 2002 From: denis.fan@dcs.warwick.ac.uk (Denis Fan) Date: Wed, 16 Oct 2002 12:25:15 +0100 Subject: [Image-SIG] Bus Error References: <3DAC1691.36168B17@dcs.warwick.ac.uk> <009401c274e5$07d5f370$0900a8c0@spiff> Message-ID: <3DAD4C9B.171BDC2C@dcs.warwick.ac.uk> --------------C253A2E389F114BA900581D8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Fredrik Lundh wrote: > > I can also imported Image and ImageTk successfully in Python, but when I > > tried to do the task below, problem came: > > > > im = Image.open(photo.gif) > > photo = ImageTk.PhotoImage(im) > > ----> in the process of creating photo ... Bus Error (core dumped) > > appear .... > > > > even though I tried > > im = Image.open(photo.gif) > > tkim = ImageTk.PhotoImage(im.mode, im.size) > > tkim.paste(ImageEnhance.Contrast(im).enhance(2.67)) > > ----> in the process ... Bus Error (core dumped) appear .... > > > > why? Did I do something wrong with the installation? > > what Tk version are you using? > do you get a stack trace if you run this under a debugger? The Tk and Tcl are in version 8.2, is that why? or should I need to install a newer version of TK? I have looked at some tutorial on the web, which teach you how to use the debugger, but I am still not fully understand the main concept of how does it work, has anyone got any link or docs that can help? Thanks -d -- --------------C253A2E389F114BA900581D8 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Fredrik Lundh wrote:
> I can also imported Image and ImageTk successfully in Python, but when I
> tried to do the task below, problem came:
>
> im = Image.open(photo.gif)
> photo = ImageTk.PhotoImage(im)
> ----> in the process of creating photo ... Bus Error (core dumped)
> appear ....
>
> even though I tried
> im = Image.open(photo.gif)
> tkim = ImageTk.PhotoImage(im.mode, im.size)
> tkim.paste(ImageEnhance.Contrast(im).enhance(2.67))
> ----> in the process  ... Bus Error (core dumped) appear ....
>
> why? Did I do something wrong with the installation?

what Tk version are you using?
do you get a stack trace if you run this under a debugger?

The Tk and Tcl are in version 8.2, is that why? or should I need to install a newer version of TK?

I have looked at some tutorial on the web, which teach you how to use the debugger, but I am still not fully understand the main concept of how does it work, has anyone got any link or docs that can help?

Thanks
-d

--
  --------------C253A2E389F114BA900581D8-- From rhyde99@msn.com Wed Oct 16 20:07:07 2002 From: rhyde99@msn.com (Roger & Arlene) Date: Wed, 16 Oct 2002 12:07:07 -0700 Subject: [Image-SIG] Windows video Message-ID: Does anyone know if a library is available to write AVI video files with Python on Win32? I shudder at the thought of having to wrap Video for Windows myself, since I'm largely ignorant of C++! Any pointers on creating video with Python would be useful. From Jack.Jansen@oratrix.com Thu Oct 17 21:45:59 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Thu, 17 Oct 2002 22:45:59 +0200 Subject: [Image-SIG] Windows video In-Reply-To: Message-ID: <7158D1FC-E211-11D6-BE1A-003065517236@oratrix.com> On woensdag, oktober 16, 2002, at 09:07 , Roger & Arlene wrote: > Does anyone know if a library is available to write AVI video > files with > Python on Win32? I shudder at the thought of having to wrap Video for > Windows myself, since I'm largely ignorant of C++! Any > pointers on creating > video with Python would be useful. If you can live with Quicktime in stead of AVI then there's a little-known solution (little known because I did the work two years ago but never advertised it): the Python quicktime module (included in the standard distribution, but usually enabled only in MacPython and on OSX) will work on Windows with only a few minor modifications. But you will of course need to have Quicktime installed. Python's quicktime module is automatically generated and exports about 90% of the full API. If there's interest in this people could plead with me to fire up my Windows machine and put the mods into the repository, -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From klimek@grc.nasa.gov Fri Oct 18 10:46:19 2002 From: klimek@grc.nasa.gov (Robert Klimek) Date: Fri, 18 Oct 2002 09:46:19 +0000 Subject: [Image-SIG] Windows video In-Reply-To: <7158D1FC-E211-11D6-BE1A-003065517236@oratrix.com> References: <7158D1FC-E211-11D6-BE1A-003065517236@oratrix.com> Message-ID: <200210180946.19297.klimek@grc.nasa.gov> On Thursday October 17 2002 8:45 pm, Jack Jansen wrote: > On woensdag, oktober 16, 2002, at 09:07 , Roger & Arlene wrote: > > Does anyone know if a library is available to write AVI video > > files with > > Python on Win32? I shudder at the thought of having to wrap Video fo= r > > Windows myself, since I'm largely ignorant of C++! Any > > pointers on creating > > video with Python would be useful. > > If you can live with Quicktime in stead of AVI then there's a > little-known solution (little known because I did the work two > years ago but never advertised it): the Python quicktime module > (included in the standard distribution, but usually enabled only > in MacPython and on OSX) will work on Windows with only a few > minor modifications. But you will of course need to have > Quicktime installed. Python's quicktime module is automatically > generated and exports about 90% of the full API. > > If there's interest in this people could plead with me to fire > up my Windows machine and put the mods into the repository, I'm interested! But I also need this to run on LInux... Is that asking f= or=20 too much? Bob From rhyde99@msn.com Fri Oct 18 15:13:24 2002 From: rhyde99@msn.com (Roger & Arlene) Date: Fri, 18 Oct 2002 07:13:24 -0700 Subject: [Image-SIG] Windows video In-Reply-To: <7158D1FC-E211-11D6-BE1A-003065517236@oratrix.com> Message-ID: >If there's interest in this people could plead with me to fire >up my Windows machine and put the mods into the repository, Quicktime it is, then! If you can be persuaded, I'd be very interested in a Windows mod of the QT library. -Roger Hyde From Jack.Jansen@oratrix.com Fri Oct 18 20:43:22 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 18 Oct 2002 21:43:22 +0200 Subject: [Image-SIG] Windows video In-Reply-To: <200210180946.19297.klimek@grc.nasa.gov> Message-ID: On vrijdag, okt 18, 2002, at 11:46 Europe/Amsterdam, Robert Klimek wrote: >> But you will of course need to have >> Quicktime installed. > > I'm interested! But I also need this to run on LInux... Is that > asking for > too much? Either you missed the sentence about needing to have QuickTime installed, or are Apple finally releasing QuickTime for Linux? The latter would be *very* good news, the multimedia offerings on Linux are few and far between (with only the SGI library having anything resembling a decent featureset. At least, on SGI machines, I never tried running it on other hardware). But: if QuickTime is indeed available for Linux then that should be easy to support from the Quicktime module too. And I won't even have to fire up a windows machine:-) -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From klimek@grc.nasa.gov Mon Oct 21 15:12:02 2002 From: klimek@grc.nasa.gov (Robert Klimek) Date: Mon, 21 Oct 2002 14:12:02 +0000 Subject: [Image-SIG] Windows video In-Reply-To: References: Message-ID: <200210211412.02281.klimek@grc.nasa.gov> On Friday October 18 2002 7:43 pm, you wrote: > On vrijdag, okt 18, 2002, at 11:46 Europe/Amsterdam, Robert Klimek > > wrote: > >> But you will of course need to have > >> Quicktime installed. > > > > I'm interested! But I also need this to run on LInux... Is that > > asking for > > too much? > > Either you missed the sentence about needing to have QuickTime > installed, or are Apple finally releasing QuickTime for Linux? > > The latter would be *very* good news, the multimedia offerings on Linux > are few and far between (with only the SGI library having anything > resembling a decent featureset. At least, on SGI machines, I never > tried running it on other hardware). > > But: if QuickTime is indeed available for Linux then that should be > easy to support from the Quicktime module too. And I won't even have to > fire up a windows machine:-) Well I'm not aware that Quicktime runs on Linux as an Apple release, but = other=20 efforts seem to be on the way. Here are some links: http://heroinewarrior.com/quicktime.php3 http://www.openquicktime.org/ I have no idea how these efforts relate to the quicktime in Python. Bob From Jack.Jansen@oratrix.com Mon Oct 21 22:18:56 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Mon, 21 Oct 2002 23:18:56 +0200 Subject: [Image-SIG] Windows video In-Reply-To: <200210211412.02281.klimek@grc.nasa.gov> Message-ID: On maandag, oktober 21, 2002, at 04:12 , Robert Klimek wrote: > Well I'm not aware that Quicktime runs on Linux as an Apple > release, but other > efforts seem to be on the way. Here are some links: > > http://heroinewarrior.com/quicktime.php3 > > http://www.openquicktime.org/ > > I have no idea how these efforts relate to the quicktime in Python. Not at all, I'm afraid. These libraries have a completely different API, and the Python QuickTime module wraps the Apple Quicktime API. I must say I have absolutely no clue why the people who did those two quicktime for Linux implementations decided to not follow Apple's API. It is by far the best combination of power and simplicity I've seen: powerful when you need it but simple if you want to do simple things. And easy to understand for something this size. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From jfroche@jfroche.be Wed Oct 30 09:49:51 2002 From: jfroche@jfroche.be (=?iso-8859-1?Q?Jean-Fran=E7ois_Roche?=) Date: Wed, 30 Oct 2002 10:49:51 +0100 Subject: [Image-SIG] mistakes in ImageOps.py? Message-ID: <20021030094951.GA12673@jfr> Hello, Maybe somebody noticed that before? (i didn't find out anything in the archive...) In ImageOps.py (i looked in the Windows and Linux library of pil-1.1.3) in the expand method: line 154: height = top + image.size[1] + buttom buttom doesn't exist, isn't it: height = top + image.size[1] + bottom and on the line: line 156: out.paste((left, top), image) paste is im.paste(image, box, mask) then isn't it: out.paste(image ,(left, top)) I made those modif inside my lib and yet the expand method works. Sorry if you already noticed that before. Regards, Jean-François Roche