Python Imaging Library save function syntax
Simple one I think but essentially I need to know what the syntax is for the save function on the PIL. The help is really vague and I can't find anything online. Any help'd be great, thanks :). ...
Simple one I think but essentially I need to know what the syntax is for the save function on the PIL. The help is really vague and I can't find anything online. Any help'd be great, thanks :). ...
I have a lot of images in a folder, and I would like to find images with a similar color to a pre chosen image. I would like to be able to do something like: python find_similar.py sample.jpg and have that return something like: 234324.jpg 55.jpg 9945.jpg 345434.jpg 104.jpg Is this doable? ...
I'm going to deploy a django app on a shared hosting provider. I installed my own python in my home, it works fine. My promblem comes with the installation of PIL, i have no support for JPEG after the compile process. I know that the compiler dont find "libjpeg", so i tried to install it at my home, i download the tar.gz and compile it ...
Can't seem to get crop working correctly, problem is, it crops a region of correct dimensions, but always from top left corner (0, 0), instead of from my passed coordinates. image = Image.open(input) region = image.crop((1000,400,2000,600) region.save(output) In image.py from PIL, method _ImageCrop I've printed out.. : print x0, y0, ...
I have genereated image by PIL. How can I save it to string in memory? Image.save() method requires file. I'd like to have number of such images stored in dictionary. ...
How can I do this in Python/PIL? I.e., given the four points of an offset rectangle (a photographed document), make it look flat on as if it were scanned. Is there a simple algorithm for it? Also, are there any other manipulations I should do to make it look more "scan-like"? I want to make a simple version of this program for myself ...
I want to take an image of a document that was photographed and make it look like it was scanned. Since a scanner will put a constant light source over the whole document, I want to achieve that effect on a photo of a document. The desired effect would be to remove any shadows or areas of low light (or at least make them less noticeabl...
I have a scanned image which is basically black print on some weird (non-gray) background, say, green or yellow (think old paper). How can I get rid of the green/yellow and receive a gray picture with as much of the gray structure of the original image intact? I.e. I want to keep the gray around the letters for the anti-aliasing effect ...
Hi I'm using PIL im = Image.open(teh_file) if im: colors = im.resize( (1,1), Image.ANTIALIAS).getpixel((0,0)) # simple way to get average color red = colors[0] # and so on, some operations on color data The problem is, on a few (very few, particulary don't know why those exactly, simple jpegs) I get 'unsubscri...
I want to enable a user on a website to upload an image, and write some text over it. Also, they should be able to crop/scale/move the image and text. For that stuff, I can do it in jQuery. After they've made the image the way they want it, is there a way i can take a screenshot of that image (using PiL) and save it on the server? Wh...
I'm using Python and PIL. I have images in RGB and I would like to know those who contain only one color (say #FF0000 for example) or a few very close colors (#FF0000 and #FF0001). I was thinking about using the histogram but it is very hard to figure out something with the 3 color bands, so I'm looking for a more clever algorithm. An...
I'm on Fedora Core 6 (64 bit) after "yum install libjpeg-devel" I have downloaded and built PIL. It gives the message: --- JPEG support ok Looks like JPEG built okay, but when running selftest.py: IOError: decoder jpeg not available Why would it appear to have built correctly, but fail the selftest? ...
I want to crop a thumbnail image in my Django application, so that I get a quadratic image that shows the center of the image. This is not very hard, I agree. I have already written some code that does exactly this, but somehow it lacks a certain ... elegance. I don't want to play code golf, but there must be a way to express this shor...
Are there better alternatives to PIL (Python Imaging Library - http://is.gd/3OPI ) for basic image file I/O and processing in Python? ...
Hello, I have a python script that is writing text to images using the PIL. Everything this is working fine except for when I encounter strings with carriage returns in them. I need to preserve the carriage returns in the text. Instead of writing the carriage return to the image, I get a little box character where the return should be. ...
I'm trying to make all white pixels transparent using the Python Image Library. (I'm a C hacker trying to learn python so be gentle) I've got the conversion working (at least the pixel values look correct) but I can't figure out how to convert the list into a buffer to re-create the image. Here's the code img = Image.open('img.png') i...
I'm trying to port some image processing functionality from an Image Magick command (using the Fx Special Effects Image Operator) to Python using PIL. My issue is that I'm not entirely understanding what this fx operator is doing: convert input.png gradient.png -fx "v.p{0,u*v.h}" output.png From a high level, this command takes the c...
My app reads frames from video (using pyglet), extracts a 'strip' (i.e. region - full width by 1 to 6 video lines), then pastes each strip (appends it) into an image that can later be written out an *.png file. Problem is Pyglet GL images are stored in graphics memory, so are very limited re size. My current klunky workaround is build u...
I've got a python GUI app in the workings, which I intend to use on both Windows and Mac. The documentation on Tkinter isn't the greatest, and google-fu has failed me. In short, I'm doing: c = Canvas( master=frame, width=settings.WINDOW_SIZE[0], height=settings.WINDOW_SIZE[1], background=settings.CANVAS_COLOUR ) file = ...
Hi, I have a probably very basic problem with PIL's crop function: The cropped image's colors are totally screwed. Here's the code: >>> from PIL import Image >>> img = Image.open('football.jpg') >>> img <PIL.JpegImagePlugin.JpegImageFile instance at 0x00 >>> img.format 'JPEG' >>> img.mode 'RGB' >>> box = (120,190,400,415) >>> area = img...