Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Gelonida N
Thanks again to everybody, Your answers helped me to understand better. My pragmatic solution is now to package my program with an open source .ttf font, which will be used on both platforms. On 08/04/2011 10:24 PM, Irmen de Jong wrote: > On 4-8-2011 21:30, Irmen de Jong wrote: > >> As far as

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Irmen de Jong
On 4-8-2011 21:30, Irmen de Jong wrote: > As far as I know, I did not see any difference in output on windows, linux > and mac os x > as long as the code used the same ttf file and PIL versions. (but I'll double > check now > and see if I remember this correctly). To follow up on myself, I've j

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Irmen de Jong
On 4-8-2011 20:54, Gelonida N wrote: > The reason why I want the images to look identical is very simple. > Though the final web server will run on a linux server, I use sometimes > windows for development or as test server. > > For automated tests I would have liked pixel identical images. > th

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Gelonida N
On 08/04/2011 12:32 PM, Thomas Jollans wrote: > On 04/08/11 12:04, Gelonida N wrote: Thanks for your answer. >> >From within a django application >> I'd like create a small image file (e.g. .png) >> which just contains some text. >> >> I wondered what library would be appropriate and would yield t

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Steven D'Aprano
Gelonida N wrote: > I wondered what library would be appropriate and would yield the same > result independent of the OS (assuming the versions of the python > libraries are the same) > Images should be pixel identical independent on the platform on which > the image is created. Short answer: you

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Thomas Jollans
On 04/08/11 12:04, Gelonida N wrote: > I posted already a question, but perhaps the subject line wasn't clear. > > > Subject line was "Text to image with same results on any platform" > Oh, your original message was perfectly clear, and if I knew the answer, I might have responded. Anyway, int

Re: PIL Question

2011-05-02 Thread nirinA raseliarison
[PyNewbie] Question: I can't seem to find the captured image, where does it go? for me, it just goes to the current working directory: $ python -i Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" fo

Re: PIL Question

2011-05-01 Thread Terry Reedy
On 5/1/2011 9:00 PM, Chris Rebert wrote: I would think to a file named "screen_capture.jpg" in the current working directory. What that is for IDLE, I don't know. At least on windows with 3.2, if one just starts up the shell, it is in the Pythonxy directory. If one runs a file from an edit wi

Re: PIL Question

2011-05-01 Thread Chris Rebert
On Sun, May 1, 2011 at 1:50 PM, PyNewbie wrote: > Hi, > > I'm new with Python and PIL. I have a very simple question regarding an image > capture function I'm attempting. > > Here is the code: > > from PIL import ImageGrab ImageGrab.grab().save("screen_capture.jpg", "JPEG") > > Question

Re: PIL question

2010-04-06 Thread Lie Ryan
On 04/06/10 19:47, Peter Otten wrote: > Tim Eichholz wrote: > >> I think maybe I am using the wrong function. I want to paste the >> entire 192x192 contents of cols[f] into newimage. I would think it >> works like newimage.paste(cols[f], (x, 0, 192+x, 192)) if that's not >> it I think I'm missing

Re: PIL question

2010-04-06 Thread Peter Otten
Tim Eichholz wrote: > I think maybe I am using the wrong function. I want to paste the > entire 192x192 contents of cols[f] into newimage. I would think it > works like newimage.paste(cols[f], (x, 0, 192+x, 192)) if that's not > it I think I'm missing a function Don't "think"! Read the documentat

Re: PIL question

2010-04-06 Thread Tim Eichholz
On Apr 6, 3:05 am, Peter Otten <__pete...@web.de> wrote: > Tim Eichholz wrote: > > I'm trying to cut a BMP with 80 adjacent frames down to 40 using the > > Image.copy and .paste functions but I'm getting error "ValueError: > > images do not match" on the paste line. > > newimage.paste(cols[f], (f*f

Re: PIL question

2010-04-06 Thread Peter Otten
Tim Eichholz wrote: > I'm trying to cut a BMP with 80 adjacent frames down to 40 using the > Image.copy and .paste functions but I'm getting error "ValueError: > images do not match" on the paste line. > newimage.paste(cols[f], (f*framew, 0, (f*framew)+192, 192)) The 4-tuple doesn't match the si

Re: PIL Question: Inverse of .load()?

2008-08-16 Thread Casey
On Aug 16, 3:53 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Casey wrote: > > I'm doing some image processing that requires accessing the individual > > pixels of the image. I'm using PIL 1.1.6 and creating a 2D array of > > pixel RGB tuples using the Image class instance load() method. > > load

Re: PIL Question: Inverse of .load()?

2008-08-16 Thread Fredrik Lundh
Casey wrote: I'm doing some image processing that requires accessing the individual pixels of the image. I'm using PIL 1.1.6 and creating a 2D array of pixel RGB tuples using the Image class instance load() method. load returns an access object that's attached to the image; to modify the ima

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.

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 som

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: PIL question about crop method

2006-04-05 Thread Gary Herron
John Salerno wrote: >John Salerno wrote: > > >>Diez B. Roggisch wrote: >> >> >> >>>Alternatively you can see it as boundary lines, in the order left, >>>top, right, bottom. >>> >>>(10, 20, 30, 100) >>> >>> >>So in the above, from where are the numbers being counted? 10 is ten >>pixel

Re: PIL question about crop method

2006-04-05 Thread Philippe Martin
Yes John Salerno wrote: > John Salerno wrote: >> Diez B. Roggisch wrote: >> >>> Alternatively you can see it as boundary lines, in the order left, >>> top, right, bottom. >>> >>> (10, 20, 30, 100) >> >> So in the above, from where are the numbers being counted? 10 is ten >> pixels from the l

Re: PIL question about crop method

2006-04-05 Thread John Salerno
John Salerno wrote: > Diez B. Roggisch wrote: > >> Alternatively you can see it as boundary lines, in the order left, >> top, right, bottom. >> >> (10, 20, 30, 100) > > So in the above, from where are the numbers being counted? 10 is ten > pixels from the left border of the image? 20 is twenty

Re: PIL question about crop method

2006-04-05 Thread John Salerno
Diez B. Roggisch wrote: > Alternatively you can see it as boundary lines, in the order left, top, > right, bottom. > > (10, 20, 30, 100) So in the above, from where are the numbers being counted? 10 is ten pixels from the left border of the image? 20 is twenty pixels from the top border? But

Re: PIL question about crop method

2006-04-05 Thread Gary Herron
John Salerno wrote: >I might be way off target even looking into this method for what I need >to do, but I'm still a little confused about the description of it: > >crop >im.crop(box) => image > >Returns a rectangular region from the current image. The box is a >4-tuple defining the left, upper,

Re: PIL question about crop method

2006-04-05 Thread Diez B. Roggisch
John Salerno schrieb: > I might be way off target even looking into this method for what I need > to do, but I'm still a little confused about the description of it: > > crop > im.crop(box) => image > > Returns a rectangular region from the current image. The box is a > 4-tuple defining the lef

Re: [PIL]: Question On Changing Colour

2005-10-17 Thread Terry Hancock
On Thursday 13 October 2005 02:58 pm, Andrea Gavana wrote: > # that is the old colour --> GREY > rgb_old = (0.7, 0.7, 0.7) > > So, no matter what colour I choose as a "new" colour, the Hue part of the new colour doesn't change in RGB. In other words, leaving the old value for "Saturation" and "Va

Re: [PIL]: Question On Changing Colour

2005-10-14 Thread Scott David Daniels
Try this: >>> import colorsys as cs >>> grey = (.7, .7, .7) >>> blue = (0., 0., 1.) >>> hsv_grey = cs.rgb_to_hsv(*grey) >>> hsv_blue = cs.rgb_to_hsv(*blue) >>> hsv_grey (0.0, 0.0, 0.69996) >>> hsv_blue (0.3, 1.0, 1.0) The problem is that the saturation of the gr

Re: [PIL]: Question On Changing Colour

2005-10-14 Thread Iain King
Andrea Gavana wrote: > I have tried your solution, Terry: > > > new_hue # your 'basic color', just the hue part > > rgb_base # color from the basic button image > > rgb_new # the new color you want to replace rgb_base with > > > > rgb_new = hsv_to_rgb( (new_hue,) + rgb_to_hsv(rgb_base)[1:]) >

Re: [PIL]: Question On Changing Colour

2005-10-13 Thread Andrea Gavana
I have tried your solution, Terry: > new_hue # your 'basic color', just the hue part > rgb_base # color from the basic button image > rgb_new # the new color you want to replace rgb_base with > > rgb_new = hsv_to_rgb( (new_hue,) + rgb_to_hsv(rgb_base)[1:]) thanks a lot for your suggestion!

Re: [PIL]: Question On Changing Colour

2005-10-11 Thread jepler
If you're always going from grey to tinted, then the easiest way is to treat it as a 'P' image with a special palette. I believe this function will prepare the palette: def make_palette(tr, tg, tb): l = [] for i in range(255): l.extend([tr*i / 255,

Re: [PIL]: Question On Changing Colour

2005-10-11 Thread Terry Hancock
On Wednesday 12 October 2005 05:28 pm, Andrea Gavana wrote: > Now my question: is it possible to transform the pixels colours in order to have another basic colour (say blue)? In other words, the predominant colour will become the blue, with other pixels in a brighter or darker blue to give the

Re: PIL question: keeping metadata

2005-07-03 Thread Jarek Zgoda
Ilpo Nyyssönen napisał(a): >>>Is there any way of keeping this info in PIL? >> >>I don't think so... when I investigated in the past, I think I >>discovered that the PIL can't write EXIF data (I might be wrong, >>though, or my information might be outdated). > > There is this: > > http://mail.py

Re: PIL question: keeping metadata

2005-07-02 Thread Ilpo Nyyssönen
"Will McCutchen" <[EMAIL PROTECTED]> writes: >> Is there any way of keeping this info in PIL? > > I don't think so... when I investigated in the past, I think I > discovered that the PIL can't write EXIF data (I might be wrong, > though, or my information might be outdated). There is this: http:

Re: PIL question: keeping metadata

2005-06-29 Thread Will McCutchen
> Is there any way of keeping this info in PIL? I don't think so... when I investigated in the past, I think I discovered that the PIL can't write EXIF data (I might be wrong, though, or my information might be outdated). > Alternatively, is there a simple image > processing package that does it?