Category "python-imaging-library"

TypeError: int() argument must be a string, a bytes-like object or a number, not 'Image'

I have a folder with images, I read all the images and resize them from 300x300 to 96x96 with this code: from PIL import Image import os size = (96,96) list_of

Check if pictures are similar in Python

I'm facing the following problem: I have N pictures (300x300pixels, anchor is always top left). Of these N pictures, some are are the same, just mirrored and/or

porting PIL python 2.x to pillow python3.10

I am trying to port an old library from python 2.x which uses PIL to Python 3.10 with PILLOW. right now I am stuck the old library uses the fromstring command:

Converting Images to ASCII art using Python & Python Imaging Library

I'm currently trying to write a program that converts images into ASCII art in Python using Python Image Library Here's what I got so far: import PIL.Image # a

Python - stitch images back together after slicing

I have a directory of image patches that are all the same size (33x33), the images are ordered so that the first 7 images are row 1, then the next 7 images are

Python Image Library and Tkinter Clashing

I have an issue where PIL and Tkinter are not working together in the same program. Basically, I tried to run my program and when it was on the line 'image.open

Fastest way to remove white background from image/video

I need to make the below faster as I need it to run on a video. Basically I am trying to remove a white background on a video and then overlay that onto another

PIL arc position on Oled Display

I am busy with something witch is not so familiar to me. Trying to design a small logo to be displayed on a Oled display sh1106, 128x64 I am using PIL and Luma

PIL opens only first chanel of TIF image

I'm trying to open (and then process) a 3-channel Tif image (8-bits) created with ImageJ. im = Image.open('spinal.tif') im.show() shows me a png for the first

PIL opens only first chanel of TIF image

I'm trying to open (and then process) a 3-channel Tif image (8-bits) created with ImageJ. im = Image.open('spinal.tif') im.show() shows me a png for the first

How to draw on an image Tkinter canvas, PIL

I would want to be able to draw on an image being displayed by a tkinter canvas PIL. I tried google searching but all the results would be how to draw on an ima

How can I go about averaging different sized images?

I have a collection of images from tissue sections which contain a specific area of interest. Given this is biology, each image is slightly different (position

What can be a faster way to iterate through the pixels of an image?

I'm trying to loop through all the pixels of an image using Pillow then append the pixels with their corresponding RGBA color into a dictionary What I have at p

Combining various image channels after gaussian filtering produces white image

I am trying to implement a gaussian filter for an image with dimensions (256, 320, 4). I first generated a gaussian Kernel for the same and then individually pe

Python PIL save method rotates image

I have a little issue with saving image with PIL. In my Django project I have the following save method: from PIL import Image class Photo: image = models.

Finding a specific shape position in the Image

I want to Finding a specific shape position in the Image. Firstly, I have a main image like below and I have multiple icons like below. I want to find the posit

pyautogui.displayMousePosition() doesn't work in pyautogui

enter code hereHello! I tried get the RGB color of the mouse position (like showed in this video https://www.youtube.com/watch?v=TERKvqfySYI) with pyautogui.dis

Applying a gradient map from image to another image with transparency in Python (PIL, numpy, etc)

I've been struggling with trying to apply a gradient map which is sourced from an image file to a grayscale image which includes alpha/transparency. The followi

Rotate native iPhone images based on EXIF info?

Working on a site where users can upload photos. As many of you many know, unedited iPhone photos use an "Orientation" EXIF tag to determine orientation. On my

What is the equivalent of reading a jpg file using PIL image?

Using python 3.10. My issue is I read a jpg file as a binary file and I get a bytes array. I have the following code: from PIL import Image def get_image_bytes