Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [python-imaging-library]

The Python Imaging Library (PIL) provides the Python language with a de-facto standard foundation for image work. PIL’s API is lightweight but semantically consistent; it furnishes a range of comfortably Pythonic tools throughout much of the imaging lexicon: processing, analysis, compression and codec abstraction, etc. – all of which builds upon a bespoke and readily extensible library structure.

python-imaging-library
0 votes
0 answers
22 views

Does Image.fromarray works only with numpy.array objects?

That's a simple question, but I'm using numpy for the first time so I'm quite confused. I think I understand the how should it works: my function named img_PILarray below creates an array object ...
gravy's user avatar
  • 1
0 votes
1 answer
13 views

How can you capture a screenshot of any window using Python on Wayland?

For context I have a PyQt5 widget with a single button that let's me select a region of the screen to capture. I can use pillow and mss to capture stuff on X11 like so def take_screenshot(self, x1, y1,...
Vanillaice's user avatar
0 votes
1 answer
26 views

TKinter places a strange white box on a displayed image

I am developing a GUI using TKinter that allows users to interactively set parameters that are used for processing some images. The GUI displays the image that is being analyzed so that users can see ...
mrfraud's user avatar
0 votes
0 answers
34 views

Emojis not rendering with colors

I am trying to add COLOR emojis onto images as overlay, but it seems like the emojis keep being rendered in black and white, and also transparent: This is what I'm currently working with: def ...
jet chua's user avatar
0 votes
1 answer
30 views

Error loading .jpg images in tkinter window using tk.PhotoImage

Question: I am working on a tkinter application where I need to display images in the GUI. While loading .png images works perfectly fine, I am encountering difficulties when attempting to load .jpg ...
Ahmed Alsayadi's user avatar
0 votes
1 answer
26 views

Image to radar values

I am trying to do similarly to the topic responded to in:RADAR image for dBZ values However, here I have a figure with different dimensions and a color palette that is not so simple. Legend: image: ...
Lucas Fagundes's user avatar
0 votes
0 answers
26 views

When saving WebP using PIL in Python, the last pixel (bottom-right) becomes black

Problem: When saving a sequence of images as a lossless WebP animation using PIL, the last pixel (bottom-right) becomes black. from PIL import Image for png_file in png_files: image = Image.open(...
fabpub's user avatar
  • 51
-1 votes
0 answers
34 views

In Python(PIL, EXIF data info), What's the meaning this key? (59932 → 0xEA1C) [closed]

I'm using PIL. I'm checking for cases that exif data has been modified. (DateTime) So I use _getexif() method and get the EXIF datas. The original photo does not have this key (59932), but the ...
Hwng's user avatar
  • 1
0 votes
1 answer
22 views

When calling torchvision.transforms.Normalize and converting to PIL.Image, how are values above 1 handled?

Applying torchvision.Normalize should lead to values below 0 and above 1, and thus below 0 and 255 when switching to integer values. However, when watching the values, this seems NOT to be the case. ...
GabrielGodefroy's user avatar
0 votes
1 answer
16 views

Why Image Pasting not working in Python using Image Module

from PIL import Image, ImageOps import sys list = ['jpg', 'jpeg', 'png'] before = sys.argv[1] after = sys.argv[2] if len(sys.argv) == 3: if before[-3:] in list and after[-3:] in list and after[...
ABDUL AZEEM ANSARI's user avatar
2 votes
1 answer
49 views

How to fit an image exactly inside an Excel cell using Python and XlsxWriter?

I'm working on a Python script that inserts images into Excel cells using the XlsxWriter library. My goal is to have each image fit precisely within its cell, without any overflow or unused space. ...
user321627's user avatar
  • 2,496
0 votes
1 answer
71 views

Reshape array to RGB array with missing values

I'm creating a tkinter user interface to display several images which a user will manipulate (translate and rotate) over each other. As the user is manipulating the images I need to calculate the new ...
Paul's user avatar
  • 41
-2 votes
0 answers
20 views

TensorFlow/Keras `load_img` Error: "Could not import PIL.Image"

I am facing an import error despite downloading the pillow module and yes I have uninstalled pillow despite that I am facing the error. Any idea how to fix it? https://i.sstatic.net/eAhcTExv.png I am ...
Priyansu Nayak's user avatar
0 votes
1 answer
53 views

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\Downloads.png' in Python

Everything was going smoothly until I tried to use PIL, I have been stuck on this for a few days, so if you can help, it will be very good. import PIL from PIL import Image fp = Image.open(r"C:\...
VAN's user avatar
  • 3
0 votes
1 answer
53 views

Drawing a circle around a png image using PIL

I am trying to put player headshots inside / mask a circle around. However, I get a colour on the background rather than transparent. Does anyone have any idea how I might achieve this? PS. I don't ...
Peter Skeels's user avatar

15 30 50 per page
1
2 3 4 5
675