Re: [Image-SIG] Unable to draw compound character of a kannada lang over an image.

2010-10-06 Thread Laura & Edward Cannon
I noticed that you said font=font2, but have not declared font2, it should be font=font. Besides that I messed around a bit with your code and can't get it to work, but I don't have fonts with the right glyphs, so I just get boxes. I assume that this font renders correctly elsewhere. If that is the

Re: [Image-SIG] weird windows 7 error with ImageFont

2010-05-07 Thread Laura & Edward Cannon
running the selftest.py I find the following output: PIL 1.1.7 TEST SUMMARY Python modules loaded from C:\Python26\lib\site-packages\PIL Binary modules loaded f

[Image-SIG] weird windows 7 error with ImageFont

2010-05-05 Thread Laura & Edward Cannon
I am running python 2.6.4 (32 bit) on windows 7 Home Premium (64 bit). I installed PIL 1.1.7 a few months ago from the official installer. I sat down today and tried to load a font using the ImageFont.truetype function. I get the following error. ImportError: The _imagingft C module is not installe

Re: [Image-SIG] ImageStat silent convert

2010-03-12 Thread Laura & Edward Cannon
b 17, 2010 at 6:57 AM, Laura & Edward Cannon > wrote: >> while using PIL 1.16 recently, I noticed that ImageStat seems to do a >> silent convert to mode L when given a mode F image. Looping though the >> image manually using the im.load() access object gives me a different

Re: [Image-SIG] PIL 1.1.6 can't convert 16-bit (I; 16) to 8-bit ('L')--Windows 32-bit

2010-03-02 Thread Laura & Edward Cannon
How I would convert the image is im.convert("L") I have had success using this method for a variety of less common formats, and it handles all the conversion for you. Edward On Sun, Feb 28, 2010 at 7:50 PM, Karl Garsha wrote: > Greetings, > > I'm reading in a 16-bit monochrome image using PIL on

Re: [Image-SIG] How to improve rotation quality?

2010-02-17 Thread Laura & Edward Cannon
Try using Image.ANTIALIAS, I find it has the best quality. On Wed, Feb 17, 2010 at 3:30 AM, Alec Bennett wrote: > I'm wondering if anyone has any idea how to get better results from PIL's > rotate() function? No matter what filter I use I'm getting very jagged edges > after rotating an image. > >

[Image-SIG] ImageStat silent convert

2010-02-17 Thread Laura & Edward Cannon
while using PIL 1.16 recently, I noticed that ImageStat seems to do a silent convert to mode L when given a mode F image. Looping though the image manually using the im.load() access object gives me a different maximum than ImageStat.Stat(im).extrema. Is this intentional? it doesn't seem to be docu

Re: [Image-SIG] Support of RGB 16 bits images

2010-02-16 Thread Laura & Edward Cannon
I have a similar question. PIL supports 16 bit integer for single band images, but not multi-band images. Messing around a bit with the 1.16 version, I find that many of the operations in the library are for 8 bit bands only. ImageMagick has python bindings and supports a wide variety of formats, c

Re: [Image-SIG] BUG? PIL does not recognise alpha channel in attached png file

2010-02-14 Thread Laura & Edward Cannon
I confirm the results PIL 1.16 Python 2.5.2 Seems pretty odd. What program did you use to create the image? On Mon, Jan 25, 2010 at 8:50 PM, Root wrote: > Hi, > > The attached image shows an alpha channel when viewed with gimp or eog, but > not when loading with PIL (version 1.1.6-3ubuntu1 as sup

Re: [Image-SIG] Colorize Image

2010-02-11 Thread Laura & Edward Cannon
There is a function for this. from the handbook: ImageOps.colorize(image, black, white) => image Colorize grayscale image. The black and white arguments should be RGB tuples or color names; this function calculates a colour wedge mapping all black pixels in the source image to the first colour, an

Re: [Image-SIG] How to "crop" along a mask?

2010-02-11 Thread Laura & Edward Cannon
at 11:15 AM, Laura & Edward Cannon wrote: > Using imagechops, multipy the alpha channels. If your source image in > white everywhere you could just multiply the images. Alternately you > could add the mask from the one image to the other image using the > addalpha method which tak

Re: [Image-SIG] Image.show doesn't show image

2010-01-11 Thread Laura & Edward Cannon
I have been running vista for some time, and it dosen't seem to work on vista at all. Which version of the library are you running? On Thu, Dec 31, 2009 at 5:53 AM, wrote: > > I'm running under Microsoft Vista in a pc environment. > > > > The atached PILTest.py yields a  Windows Photo Galery wind

[Image-SIG] F mode images and support for filters

2009-12-27 Thread Laura & Edward Cannon
Do F (floating point) images support the im.filter method and/or the filters in ImageFilter? When I tried to filter an F mode image I received ValueError: image has wrong mode. The documentation doesn't mention this either way. Edward ___ Image-SIG mailli

[Image-SIG] Fwd: Inverse of QUAD transform?

2009-12-06 Thread Laura & Edward Cannon
-- Forwarded message -- From: Laura & Edward Cannon Date: Fri, Nov 27, 2009 at 11:48 AM Subject: Re: [Image-SIG] Inverse of QUAD transform? To: Mark Wendell there is a (undocumented) perspective method that might do what you want. as I recall http://mail.python.org/piper

Re: [Image-SIG] transparency in palette mode ( "P" ) images

2009-10-21 Thread Laura & Edward Cannon
Hm.. you seem to be right. One thing you might do is im = Image.open("test.png").convert("RGBA") which seems to solve the transparency problem, at the expense of a slightly larger image file. Looking closer I think that PIL seems to support only RGB palettes rather than RGBA palettes as does the PN

Re: [Image-SIG] unexpected result when using Image.composite

2009-10-19 Thread Laura & Edward Cannon
I have discovered the source of the problem. the bg image is mode RGBA, when I convert it to RGB, the result is as expected. On Thu, Oct 15, 2009 at 9:55 PM, Laura & Edward Cannon wrote: > I am using Image.composite to combine two images and am getting > unexpected results. Partially t

Re: [Image-SIG] JPEG low quality

2009-09-24 Thread Laura & Edward Cannon
On Wed, Sep 2, 2009 at 1:04 PM, Vinicius Mendes wrote: > Hi, > > I've created a script using PIL that opens a JPEG image and saves it with > another name. What happens is that the saved image's quality is gets very > low, even if I set quality=100. Somebody already experienced such a problem? > Kn

Re: [Image-SIG] Problem when resizing large JPEG to thumbnail

2009-09-24 Thread Laura & Edward Cannon
On Mon, Aug 31, 2009 at 7:44 PM, Etienne Desautels wrote: > > Hi, > > I'm using sorl-thumbnail in Django to automatically resize my images. > sorl-thumbnail use PIL to do is image manipulations. > > Unfortunately the result thumbnails are far from pretty. You can see some > tests here: > http://ww

[Image-SIG] perspective type to Image.transform

2009-08-22 Thread Laura & Edward Cannon
I noticed that a version or two ago PERSPECTIVE was added along with AFFINE, QUAD, etc. to Image.transform. Did this make it into the 1.1.7 documentation? Edward Unicorn School ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman

Re: [Image-SIG] Workarounds for MemoryErrors

2009-06-23 Thread Laura & Edward Cannon
Off the top of my head I would divide the image into horizontal bands and only work on one part at a time, writing the rest to disk. At the final join I would write a custom file writter that wrote to some very simple file format such as .tga or .bmp and could handle just appending the new pixel da

Re: [Image-SIG] remove an image background using PIL

2009-05-31 Thread Laura & Edward Cannon
One way to get rid of a single color background is to get the background color (look at the upper left pixel) and then compare every pixel to it. If they are the same, make it transparent, otherwise leave it be. This obviously only works if nothing in the foreground is colored the same as the backg

Re: [Image-SIG] PIL - Tiff problems

2009-05-12 Thread Laura & Edward Cannon
You don't need to convert to mode P for png, and that might be some of the issue. PNG supports mode L. On Mon, May 4, 2009 at 10:44 AM, Andrew wrote: > In reality the tif will be ~7 mb, but i was able to use pil to shrink the > image size. The problem comes with converting to a png. > > I open th

Re: [Image-SIG] pencil sketches

2009-04-27 Thread Laura & Edward Cannon
Theoretically yes, easily no. On Wed, Apr 22, 2009 at 4:24 PM, Kevin Castiglione < kevincastigli...@gmail.com> wrote: > hi guys > i want to generate pencil sketch sort of effect on images with faces in > images. > is it possible to do this effect in PIL? > thanks > ___

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-07 Thread Laura &amp; Edward Cannon
h time the mouse moves you move the image. > > What about rubber lines, stretching, for an to resize an object like a box? > > Laura & Edward Cannon wrote: >> >> I have had great success "moving" items across images by keeping a >> copy of the original

Re: [Image-SIG] Why Suspicious Headers?

2009-04-03 Thread Laura &amp; Edward Cannon
I also find that unless I send the message directly to image-sig@python.org I get held. (my mail client likes to respond the the person and CC image-sig@python.org) That might also be the cause of your problem. On Fri, Apr 3, 2009 at 6:17 PM, Fredrik Lundh wrote: > > Your mail program produces HT

[Image-SIG] autodetecting fonts

2009-03-28 Thread Laura &amp; Edward Cannon
using PIL is there a good way to autodetect what fonts a user has installed? This would be useful for applications that wanted to let a user select a font, that way no assumptions have to be made about the fonts on a particular computer and the user would have access to the widest range of fonts po

Re: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file

2009-03-25 Thread Laura &amp; Edward Cannon
This is correct, windows makes a distinction between text and binary files, and linux does not, I have had quite a bit of trouble in that regard, especially as I switched from linux to windows. Edward On Wed, Mar 25, 2009 at 8:38 AM, Fredrik Lundh wrote: > 2009/3/25 Bryan Jeal : >> Here is an upd

Re: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file

2009-03-24 Thread Laura &amp; Edward Cannon
there are windows binary packages for both python and PIL available (http://www.pythonware.com/products/pil/) and I have used these on XP and Vista for years with 0 problem. I don't need Cygwin or Mingw32 or anything else, just install the python and then install the binary. I do jpeg all the time.

[Image-SIG] perspective method

2009-03-13 Thread Laura &amp; Edward Cannon
A while back a read about, and even used, an experimental feature in PIL 1.1.16 it was a new feature to the im.transform() method. as I recall it was im.transform(size, PERSPECTIVE, data, filter) where data was the transformation matrix. I was wondering what the status of this feature was. It worke

Re: [Image-SIG] Using PIL to merge postscript generated text and png files

2009-03-05 Thread Laura &amp; Edward Cannon
ing the file from photoshop as a 24bit png > instead, which took the rough edges off the fonts. > > However, I'm still stuck with the issue of having no line wrapping. > > Is this something PIL can handle as well? > > C > > > On 4 Mar 2009, at 16:26, Laura &am

Re: [Image-SIG] Using PIL to merge postscript generated text and png files

2009-03-04 Thread Laura &amp; Edward Cannon
My best suggestion is to convert the font you need to a format that PIL can understand, either its own bitmap format or to a truetype font. Font conversion utilities exist, and you would only need to do the conversion once, and then just use the converted font. It may not be completely elegant, but

Re: [Image-SIG] Intelligent bracketing

2009-02-18 Thread Laura &amp; Edward Cannon
On Mon, Feb 16, 2009 at 5:38 AM, Frédéric wrote: > Hello, > > I'm starting a funny project (at least, part of a project): intelligent > bracketing. > > Many DSLR have a auto bracketing mode, where you can automatically shoot > additionnal pictures arround the current exposure. But usually, it is >

Re: [Image-SIG] adding overlay & text to many file

2009-01-14 Thread Laura &amp; Edward Cannon
Reading gimp files is tricky. Resizing photos is not hard just remember that PIL thinks in pixels, so just multiply your PPI by the dimension to get the size in pixels. Look at the paste function in the Image module for details on adding logos and bars. The ImageDraw function might be useful for th

Re: [Image-SIG] Mutable images

2008-11-21 Thread Laura &amp; Edward Cannon
Something that would be simple would be a wrapper class containing an image as an attribute. You could reference the wrapper instead of the image itself, which would solve your problem. I think you could write a wrapper in 20-30 lines of code, and probably have a very small performance hit if any.

Re: [Image-SIG] combine jpeg's

2008-11-11 Thread Laura &amp; Edward Cannon
please clarify, what exactly do you mean On Thu, Nov 6, 2008 at 6:40 AM, Nils Wagner <[EMAIL PROTECTED]> wrote: > Hi all, > > Is it possible to combine 4 jpegs into 1 jpeg ? > A small example would be appreciated. > > Thanks in advance > > Nils > _

Re: [Image-SIG] Resizing Tif's to smaller gifs adds pixels

2008-10-29 Thread Laura &amp; Edward Cannon
Your problem is that you resized the image twice. Use either the thumbnail method or the resize method, not both. (personally I would use resize) edward 2008/10/21 Samuel Mullen <[EMAIL PROTECTED]> > I'm not entirely sure how this group works: if there is a page I'm supposed > to follow up on or

[Image-SIG] antialiased lines and polygons

2008-10-22 Thread Laura &amp; Edward Cannon
A quick question, is their a way to get an antialiased line or polygon in PIL? I draw my shapes just fine, but the edges are jagged. Some packages I know can antialias to reduce the appearance of pixelization, is PIL one of those? Edward ___ Image-SIG mai

Re: [Image-SIG] Analyzing hemispheric photos?

2008-10-17 Thread Laura &amp; Edward Cannon
Python+PIL works great under vista, I use it all the time. Images can be thresholded, and the ImageStat module might have some things that you could use. On Fri, Oct 17, 2008 at 8:29 AM, Eric Graham <[EMAIL PROTECTED]> wrote: > Hello, > > I received this request via the R-Ecology mailing list and

Re: [Image-SIG] No "transparency" key in info for transparent PNG

2008-09-28 Thread Laura &amp; Edward Cannon
As far as I can tell, you should be able to determine whether or not the image has transparency by looking at the mode. if it is RGBA or LA it has transparency, otherwise it does not. If you need to know what parts are transparent, look at the mask, obtained by im.split() On Sun, Sep 28, 2008 at 4

Re: [Image-SIG] PIL on intelMac

2008-09-19 Thread Laura &amp; Edward Cannon
yes it is possible to do PIL on mac.try pythonmac.org 2008/9/18 Petro Gretchanei <[EMAIL PROTECTED]> > Hello, > i had a question if it was possible to use PIL on mac machines? If so, > where can i get the installer? > > Thank you, > > Best regards, > Petro Gretchanei > Sorenson Media, Inc. > Squ

Re: [Image-SIG] IP Geolocation

2008-09-08 Thread Laura &amp; Edward Cannon
On Sun, Sep 7, 2008 at 4:12 PM, agi20dla <[EMAIL PROTECTED]> wrote: > I created an IP geolocation script with another popular scripting > language using the Tiger/LINE database from the Census Bureau. Is there > such a module for Python? I need to get street level IP Geo for at > least USA addres

[Image-SIG] is this a bug?

2008-09-03 Thread Laura &amp; Edward Cannon
From: Laura & Edward Cannon <[EMAIL PROTECTED]> Date: Wed, Sep 3, 2008 at 8:16 AM Subject: Re: [Image-SIG] is this a bug? To: Gareth <[EMAIL PROTECTED]> I tried this out as well and got the same error. I agree this seems to be a bug, but in the short term try to get around

Re: [Image-SIG] PIL - 1.1.6, Centroid

2008-08-22 Thread Laura &amp; Edward Cannon
using the Image.load() function to create a pixel access object and loop through the file. g = a.load() #a is an image for i in xrange(width): for j in xrange(height): #do computations here also take a look at the ImageStat module, which might save some work, as well as being faster. 2008/

Re: [Image-SIG] Changing text direction with draw.text()

2008-08-20 Thread Laura &amp; Edward Cannon
you could either make the text horizontal and rotate it using im.rotate or if that is not what you want you could get something like T H I S by looping through the string and drawing each letter separately. something like x = 100 y=100 for c in "your text here": d.draw((x,y), c ...) #d is a draw

Re: [Image-SIG] RGB[8:8:8] to RGB[4:4:4] and RGB[12:12:12]

2008-08-18 Thread Laura &amp; Edward Cannon
color spaces first off the data you got is not character data, it is python integers, to get only 4 bits of significance try something like int(floor(x/8.0)). padding could be accomplished by multiplication by 8. The answers to these would still be python integers, which would still need to be enco

[Image-SIG] PIL 1.1.6 (OSX Leopard and Windows XP) Image.rotate causes very pixelated results

2008-07-24 Thread Laura &amp; Edward Cannon
Regarding rotating images, try Image.ANTIALIAS as the filter, I find that that gives the best results. Another trick that can help is resizing the image to double the size, rotating, then resizing to a smaller size. ___ Image-SIG maillist - Image-SIG@py

[Image-SIG] new version/features

2008-07-24 Thread Laura &amp; Edward Cannon
I had noticed that it has been a while since 1.1.6. Do we have an ETA for a new version of the library? Thanks, Edward ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig