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
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
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
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
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
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.
>
>
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
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
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
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
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
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
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
-- 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
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
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
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
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
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
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
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
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
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
> ___
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
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
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
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
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.
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
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
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
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
>
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
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.
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
> _
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
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
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
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
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
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
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
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/
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
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
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
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
47 matches
Mail list logo