10,135 questions
Advice
1
vote
8
replies
86
views
Download smaller version of large image over network
Our organization has HD images that are over 20 MB in size on a network drive. When trying to preview them, is it possible to have python download a smaller version of them (to reduce bandwidth) with ...
3
votes
2
answers
78
views
Font size in Python Pillow and Microsoft Word
I want to make images in Python Pillow with text, insert the images into a Microsoft Word document, and have the font size in the image match the font size in the document. How do I make the font ...
0
votes
1
answer
87
views
NiceGUI and Image Flicking during brighness adjustment
I would like to know why image flicking while adjust it's brightness during adjustment. here is my script:
from nicegui import ui
from PIL import Image, ImageEnhance
import io, base64
original_image = ...
5
votes
1
answer
150
views
Rotating an image, how to fix "Index Error: image index out of range"?
I'm attempting to rotate an image in python by copying each individual pixel into a new blank image, (I know, probably not the best way to do it but this is what I have the theoretical knowledge basis ...
0
votes
2
answers
87
views
How does Python PIL decide if TIFF Image is RGBA or CMYK?
In C/C++, we use libtiff 4.6.0 to parsing TIFF images. We identify the type of TIFF image with:
unsigned int PhotoMetric = 0, SamplesPerPixel = 1, BitsPerSample = 1;
TIFFGetField(Tiff, ...
1
vote
1
answer
91
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-...
0
votes
2
answers
98
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
39
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
81
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
69
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
128
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
86
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
157
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
81
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, ...