Category "python-imaging-library"

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

PIL TypeError: Cannot handle this data type

I have an image stored in a numpy array that I want to convert to PIL.Image in order to perform an interpolation only available with PIL. When trying to conver

How I can convert a list of integers to an image?

I converted an image to a list of integers. E.g. [226, 137, 125, 226, 137, 125, 223, 137, 133, 223, 136, 128, 226, 138, 120, 226, 129, 116, 228, 138, 123, 227,

Converting Image from RGBA to RGB reveals padding, how to crop that?

I'm trying to convert an image from RGBA to RGB. But the conversion to RGB is adding padding to the image. How can I convert without the padding? Or how can I r

Efficient way to shift image pixels in python

Trying to find a way to efficiently shift image pixels in python. Ultimately want to display the results on screen after each shift. For example, pixel at 1920,

How I can load a font file with PIL.ImageFont.truetype without specifying the absolute path?

When I write the code in Windows, this code can load the font file just fine: ImageFont.truetype(filename='msyhbd.ttf', size=30); I guess the font location i

Python PIL Outline image increase thicknesses

I know how to find the edges from a picture. But I would like to have the outline edges be thicker for example width 9. from PIL import Image, ImageFilter

Automatically cropping an image with python/PIL

Can anyone help me figure out what's happening in my image auto-cropping script? I have a png image with a large transparent area/space. I would like to be abl

Installing PIL on OS X Lion: initialization from incompatible pointer type

I want to run python's ndimage to do some image analysis. I have a 64-bit Mac running OSX Lion and Python 2.7. When I tried to run commands from ndimage comman

Image.open() cannot identify image file - Python?

I am running Python 2.7 in Visual Studio 2013. The code previously worked ok when in Spyder, but when I run: import numpy as np import scipy as sp import math

Multicolored text with PIL

I'm creating a web-app that serves a dynamic image, with text. Each string drawn may be in multiple colors. So far I've created a parse method, and a render m

Problem in image processing code using pillow?

I have tried to create a filter which transforms a picture. Example: The first pixel takes the color from next one, and the last one takes the color from first