python-imaging-library Questions

3

Solved

I am following the documentation: https://pillow.readthedocs.io/en/stable/ I successfully installed Pillow with pip. However, when I try to import the Image function I can: a) Only import it from P...
Carpogonium asked 3/11, 2021 at 9:15

7

Solved

I know there are lot of similar questions, but there aren't any simple enough that I am able to understand. I have the following code: import Tkinter as tk from PIL import Image, ImageTk class Ma...
Skantze asked 17/6, 2014 at 22:6

3

TLDR; I'm trying to take a TIFF, resize it, then save it. However it returns an error. This works fine if I change the saved filetype to png or jpg. System: Windows 7 Tried using both Python 3.4 a...
Amieeamiel asked 28/10, 2014 at 23:6

2

Solved

I am learning to use 'pillow 5.0' following book 'Automate the boring stuff with python' The info about the image object In [79]: audacious = auda In [80]: print(audacious.format, audacious.size,...
Laocoon asked 14/1, 2018 at 9:52

3

Solved

For my telegram bot (python-telegram-bot) i generated a PIL.Image.Image and i want to send it directly to a user. What works is to send an image as bufferedReader from a file, but i don't want to ...

2

I would like to display image samples and some related textual information with them, in table. Is it possible to do this in jupyter notebook? I tried to mix pandas and PIL, but it didn't work: ...
Henleyonthames asked 4/11, 2017 at 18:12

2

Solved

This works: from PIL import Image, ImageFont, ImageDraw def create_image_file(name='test.jpeg', ext='jpeg', size=(500, 500), color=(5, 179, 200)): file_obj = open(name, 'w') image = Image.new("...
Disembodied asked 5/5, 2016 at 10:57

7

Solved

When I write the code in Windows, this code can load the font file just fine: ImageFont.truetype(filename='msyhbd.ttf', size=30); I guess the font location is registered in Windows registry. But...
Chrysalis asked 6/6, 2014 at 15:53

31

Solved

I use this command in the shell to install PIL: easy_install PIL then I run python and type this: import PIL. But I get this error: Traceback (most recent call last): File "<console>", l...
Bedight asked 14/1, 2012 at 17:24

2

Solved

I'm trying to convert .jpg images to webp format using PIL. I'm using the this code: from PIL import Image import glob, os for infile in glob.glob("*.jpg"): file, ext = os.path.splitext(infile)...
Eliathas asked 8/11, 2013 at 13:49

5

Solved

I want to find the sub-image from large image using PIL library. I also want to know the coordinates where it is found ?
Shrug asked 10/7, 2013 at 9:14

2

Solved

Here is my code: img = Image.open('data/img.jpg') lb = Image.open('data/label.png') img.show('img') img.close() lb.show('lb') lb.close() After running this program, the first image is successfu...
Rowlock asked 13/11, 2018 at 11:1

9

Solved

I know PIL is deprecated, so I installed Pillow instead, and for backward compatibility reason, Pillow is still using PIL as its module name. Here's my pip freeze look like for Pillow: Pillow=3.2.0...
Xi asked 30/6, 2016 at 22:38

0

I'm adding text to images using python and pillow. I draw a rectangle first, for the background, and then add an outline by drawing 4 lines. The issue I have is that the text can seem as if it's no...
Coastguardsman asked 23/2, 2024 at 3:10

3

Solved

How do I create a pickleable file from a PIL Image object such that you could save those images as a single pickle file then maybe upload to another computer such as a server running PIL and unpick...
Incurve asked 12/4, 2012 at 5:49

4

This is similar to this question, except that the solution there doesn't work for me. Viewing a HEIC file in Windows Explorer, I can see several dates. The one that matches what I know is the date...
Sublimate asked 24/9, 2019 at 21:9

4

Solved

I have several images which I would like to show the user with Python. The user should enter some description and then the next image should be shown. This is my code: #!/usr/bin/python # -*- cod...
Flawed asked 17/7, 2011 at 16:8

4

Solved

Basically I'm trying to be able to rotate images via user interface, however I've noticed that the image quality severely decreases upon each rotation. Does anyone know how to fix that? Also when t...
Ardehs asked 23/7, 2013 at 22:13

3

Solved

from PIL import Image img = Image.open('1.png') img.save('2.png') The first image has a transparent background, but when I save it, the transparency is gone (background is white) What am I doin...
Outman asked 5/8, 2009 at 14:50

25

Solved

Is there an obvious way to do this that I'm missing? I'm just trying to make thumbnails.
Brake asked 7/11, 2008 at 23:8

2

Solved

Is there a list of all the named colors available in pillow? I couldn't find reference to the exact color names in the documentation.
Oxyhydrogen asked 13/1, 2019 at 1:40

3

Solved

I'd like to work directly with compressed JPEG images. I know that with PIL/Pillow I can compress an image when I save it, and then read back the compressed image - e.g. from PIL import Image im1 ...
Tung asked 11/6, 2015 at 4:35

2

Solved

The code below brings the text in the center of x, but i don't know how to calculate the center for the y coordinate... it is not (imgH-h)/2! (The right y-coordinate is -80) from PIL import Image...

1

I'm trying to run a old project here is my requirements.txt asgiref==3.4.1 astroid==2.3.3 certifi==2019.11.28 chardet==3.0.4 Django==4.0.1 django-cleanup==5.2.0 idna==2.8 isort==4.3.21 lazy-o...
Rhapsodist asked 20/1, 2024 at 17:8

11

I have an application that loads an Image and when the user clicks it, a text area appears for this Image (using jquery), where user can write some text on the Image. Which should be added on Image...
Sepulchre asked 4/5, 2013 at 10:44

© 2022 - 2025 — McMap. All rights reserved.