10,134 questions
1
vote
1
answer
74
views
How to read a chunk of big tiff file in Python? [closed]
I have a TIFF file with a size of (48000, 432000) and I would like to upload only a piece of the image, for example, pass a parameter like (X, Y, wid, hei), where X, Y are the coordinates of the upper-...
-1
votes
0
answers
51
views
How can I mask parts of an image with PyAutoGUI? [closed]
Using PyAutoGUI to build an OCR algorithm I am experiencing issues with certain letters.
Reading this image outputs "lake on Me" (that is a capital i). I expected a "T" but as the &...
0
votes
2
answers
84
views
Problem with offset when rotating text on an image (Pillow)
main.py
from PIL import Image, ImageDraw, ImageFont
base_img = Image.new("RGBA", (100, 100), (0, 255, 0))
txt = 'Sample <del color=red>text<del>'
rotate = 120
font = ImageFont....
0
votes
0
answers
34
views
Why does PIL Image use inverse of affine transformation matrix as argument?
Affine transformations (rotations, translations, shears and scales) can be represented (for 2-D arrays of points) as 3x3 matrices. And it is immediately clear, by looking at this matrix, what the ...
0
votes
0
answers
74
views
Coordinates satisfied conditions are outside of the expected area
I have the following code to calculate and visualise the probability of scoring 10 points or more
This is the Scoreboard image that I used to run the code
from PIL import Image, ImageDraw
import ...
0
votes
0
answers
67
views
Strange black borders on count changes with cmath on my python fractal render
I recently wrote a program which renders the mandelbrot set and encountered some irrelevent issues, which some helpful users solved for me. One user reccommended I change an aspect of my code for ...
3
votes
2
answers
118
views
The output of my fractal program is in 4 inverted quarters
I am trying to make a python program that can render the mandelbrot set. My full program can output an image of the set, but for some reason, it displays it cut up into opposite facing quarters.
This ...
0
votes
0
answers
34
views
"Django: Cannot use ImageField because Pillow is not installed (Python 3.13, Windows) [duplicate]
PS C:\Users\ltaye\ecommerce> python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call ...
5
votes
2
answers
82
views
Pillow (PIL) affine image transform wrong direction
Using Python's Pillow (PIL) module I'm trying to shift an image 85 pixels to the right using an affine transform. The below code should to this, but instead shifts the image seemingly in the wrong ...
0
votes
1
answer
134
views
python standalone builds causes problem with pillow tkinter
I am trying to embed python standalone builds to my electron app. I downloaded standalone from https://github.com/astral-sh/python-build-standalone
Everything seems to work fine until pillow is ...
2
votes
1
answer
77
views
PIL getcolors returning None for some particular images
I am getting weird behaviour when using PIL, here is my code:
main_img = Image.open(image_url)
all_colors = main_img.getcolors(maxcolors=100000)
when I use this image:
everything works perfectly, ...
2
votes
1
answer
87
views
Getting most common colors in an image using Pillow Image.get_colors() gives wrong result
I have code which finds the top 10 colors from an image, so for that I used PIL to find all of the colors and then processed it and found the 10 most common ones, but when I try it online, results are ...
0
votes
1
answer
42
views
Replicate PIL.Image.show() scaling and normalization
I am curious what the PIL library does value scaling and normalization wise to show me crisp image and why just doing matplotlib on the extracted numpy value looks really bad.
Here is my code
...
1
vote
1
answer
74
views
Is Pillow ImageDraw.Draw.draw and Tkinter units the same?
I have a program which writes text based on the size of the image. If the size is 900x900 (tkinter units) then it will write text on 300x300, 300x600, 600x300 and 600x600, but when I try to write that,...
1
vote
1
answer
67
views
Unable to import module 'lambda_function': No module named 'PIL' even after importing pillow as a layer
I'm getting this error "Unable to import module 'lambda_function': No module named 'PIL'" when I try to run an AWS lambda that uses PIL.
What my current setup involves: I downloaded the ...