Category "python-imaging-library"

How to remove cloth from a person using python

My Input Image is this. I need only the face and hair from that image and others will convert to white background including cloth. I used mediapipe's SelfiSegm

I'm having trouble with pasting a gif on an image using PIL

from PIL import Image, ImageSequence import PIL GIF_PATH = Image.open(r"C:\Users\me_\My\Filw\Path.gif") IMAGE_PATH = Image.open(r"base.png") frames = [] for fr

Picture won't open in File Dialog, Tkinter, Pillow

I have written this. Its short and supposed to open a file dialog window, with buttons "open a file, turn, save, exit." I want to open a jpeg, turn it 180°

Image not Rendering in Python, Tkinter, PIL [duplicate]

PIL Photo not Rendering code : from tkinter import * from PIL import ImageTk, Image root = Tk() def resize_image(file_dir): full_dir =

Python program works only from pycharm, not somewhere else

The script works fine when I run it in pycharm, but if I run it from somewhere else it just doesn't work. When I run it via cmd it gives me this error: Tracebac

Write/Edit metadata in a JPG/PNG image

Usually to read metadata from an image I used PyExifTool witch is very powerfull: import exiftool exiftool.executable = "exiftool.exe" img_path = 'test.JPG'

How to fix AttributeError: 'ZipFile' object has no attribute 'seek' in this code?

My task is to take a ZIP file of images and process them, using the PIL, Tesseract, and OpenCV libraries built into Python. The files in the ZIP file are newspa

The Jupyter Notebook cell keeps being run (never stops)

In my coursework, I have to create the following picture (with one piece with no effect on it) Below is what I have tried so far: import PIL from PIL import Im

Remove border from Logo using Python PIL

Hi I want to remove the white border from this Logo using python's pillow library. The only way I have thought of is to extract all white from the image but the

Problems with using a rough greyscale algorithm?

So I'm designing a few programs for editing photos in python using PIL and one of them was converting an image to greyscale (I'm avoiding the use of any functio

Python PIL decrease letter spacing

How can I decrease the letter spacing of this text? I want to make the text more squished together by a few pixels. I'm trying to make a transparent image, wi

why cant i install ImageTk

I'm getting into Tkinter and I'm trying to put images into the windows it makes, but wherever I search the internet all I find is that I need a module called Im

How to fix "pip installation error on pillow"

I just ran pip install pillow on pycharm windows but it gives an error as mentioned below help me to solve this problem I tired manually installing pillow form

Pytorch tensor to PIL image with alpha channel

Using fastai v1, I have a model that transforms an image. When I plot the resulting image with matplotlib, the background is white; ax.imshow(image2np(img.data)

Drawing bounding rectangles around multiple objects in binary image in python

I am trying to write some easy code in python to produce bounding rectangles around objects in a binary image, where there may be 1 or more objects. This is fa

How to convert NumPy array into OpenCV (cv2) image

I have attached the image of the code here for better understanding, this would help you figure out what I am actually doingI am working on a project in which I

Unable to install Pillow for Django App using Terminal on Namecheap Shared hosting

I was going to deploy my Django App on Namecheap shared hosting. My app needs Pillow to be able to run perfectly. But while installing pillow using pip install

No module named 'PIL'

I'm running into an error where when I try from PIL import Image, ImageFilter in a Python file I get an error stating ModuleNotFoundError: No module named 'P

Numpy array of tuples to PIL image

I currently have a numpy array or RBG tuples that I want to convert to a PIL image and save. Currently I'm doing the following: final = Image.fromarray(im_arr,

How to Crop Images in a Django Application *JavaScript Issue*

I am having issues with my JavaScript code, and I am trying to get the image crop (picture) below to pop up but when I click the Choose File button but nothing