Linked Questions

1 vote
2 answers
600 views

This code: import numpy import PIL.Image base = PIL.Image.open('grin-emoji-by-twitter.png').convert('RGBA') base2 = numpy.array(base) print(base2.shape) print(base2) produces the following output: (...
xjcl's user avatar
  • 15.7k
2 votes
1 answer
447 views

I'm working with 3D boolean arrays that mask a volume. My goal is to take a mask and reduce the area of the mask by some margin, m, in all dimensions. Is there an easy way to do this using some ...
ar6's user avatar
  • 23
-1 votes
2 answers
331 views

I have written an if-elif statement, which I believe not be very efficient: first_number = 1000 second_number = 700 switch = { 'upperRight': False, 'upperLeft': False, 'lowerRight': False,...
Snow's user avatar
  • 1,138
1 vote
1 answer
530 views

I've converted the png image to a base 2-bit sequence with the following program from PIL import Image, ImageFile from io import BytesIO out = BytesIO() with Image.open("download.png") as ...
Rizkii's user avatar
  • 25
0 votes
1 answer
494 views

def rotate_picture_90_left(img: Image) -> Image: img_width, img_height = img.size pixels = img.load() # create the pixel map # for every pixel for i in range(img_width): ...
Beier Mu's user avatar
0 votes
0 answers
481 views

I want to implement PCA (Principal Component Analysis) to get an RGB version on an image . I'm opening the images from a github repository . I found a very helpful similar question here (Reverse ...
DavidDunn's user avatar
  • 153
0 votes
1 answer
316 views

I am developing an Image viewer. My main goal is to make something able to easily load .EXR files along with all other main formats. I based it around : PySide2 (Qt) for the UI. OpenImageIO for .exr ...
gui2one's user avatar
  • 190
0 votes
0 answers
343 views

I was trying to perform some data augmentation in object detection models in tensorflow so I was checking the compatibility of different image representations. First I was just reading an image file ...
Eypros's user avatar
  • 5,743
0 votes
0 answers
169 views

I am using python 2.7 with OpenCV and PIL Running on windows 10 I am trying to get an image written with cv2.imwrite() like follow Code: x={{"Some Process On an Image "}} #now saving the ...
Mohammed Ali's user avatar
  • 1,185
-1 votes
2 answers
112 views

I wrote this script to do some image processing on a large number of PNG files (around 1500 in total). They are organized into subdirectories. That's my code: from PIL import Image import os path = &...
user avatar
0 votes
1 answer
119 views

I have a short program that generates images of 1, 2, 3, and 4 random coloured circles to train a neural network on. My issue is, just doing 4000 images takes about 20-30 mins, and I need about 50000 ...
Finn E's user avatar
  • 386
1 vote
1 answer
113 views

Today I tried to switch pygame's image.load() to Pil's Image.open() but (as usual) I got problems. At the beginning of the code I have this fragment with pygame's image.load(): class Gamesprite(): ...
kapurdok's user avatar
0 votes
1 answer
66 views

I have each character as a Mat object which are of different sizes. Some sample images are, I am trying to convert them to an Image using PIL and then into a standard 12x12 matrix which will be ...
Gladiator's user avatar
  • 644
0 votes
0 answers
56 views

Could you please advise how can we convert the <PIL.Image.Image image mode=L size=675x1200 at 0x16193333D48> to Real image through Python. Because when I storing outputimg in FTP its storing ...
Manoj Poosalingam's user avatar

15 30 50 per page
1 2
3