Questions tagged [python-imageio]

Imageio is a Python library that provides an easy interface to read and write a wide range of image data including animated images, volumetric data, and scientific formats. Make to use this tag for question related to it.

191 questions
3
votes
1 answer

Python Converting ORF to jpg - LibRawFatalError: Input/output error

I am trying to convert a directory of photos from ORF to jpg using python. The image library I am using is https://github.com/letmaik/rawpy An error is occuring when I try to read an image from the path. The error is below with…
RyeGuy
  • 4,213
  • 10
  • 33
  • 57
3
votes
0 answers

Add annotation to frames using imageio (python)

Using the imageio library following this question, I'd like to add labels to each frame of a resultant movie e.g. Frame 1, Frame 2. I can create the movie but I'm not sure how to add any annotations and can't find anything in the docs. Is this…
ChrisWills
  • 131
  • 1
  • 10
3
votes
0 answers

python imageio could not load bitmap for unknown reason

I'm following this tensorflow assignment and I have an issue in the first problem. I have to load and dump some data data using a given code but for some reason It's not working. I first had this error: Could not find a format to read the specified…
Jérémy Pouyet
  • 1,989
  • 6
  • 28
  • 55
3
votes
1 answer

Removing spatial interpolation or compression in GIFs created with imageio or PIL

I am trying to create GIFs using imageio. This is fairly straightforward; however, the quality of the images is poor. They appear to be interpolated. See the figures below. I am creating the GIF using the code shown below. I've tried tracing the the…
Stephen Hartzell
  • 660
  • 1
  • 7
  • 17
2
votes
0 answers

Discoloration in GIF saved by imageio

I have a list of PIL images I want to turn into a GIF. I have a gray mouse moving around in a maze, following a cyan dot. However, the mouse renders as cyan in the saved GIF, and I don't know why. Here's a link to the GIF (in mp4 format). Here's a…
2
votes
2 answers

MoviePy RuntimeError: imageio.ffmpeg.download() has been deprecated

I try to run a simple script in Google Colab to determine a length of a video: !pip install moviepy from moviepy.editor import * # Change directory: os.chdir(r'/content/my_data') clip = VideoFileClip("my_video.mp4") print(clip.duration) However, I…
user136555
  • 255
  • 2
  • 11
2
votes
1 answer

cannot import module imageio in python3

Using python3, I am unable to import the imageio module into my python program, which I need, as I try to animate a list of PNG images I have. Thus far I have tried: "pip3 install imageio" both running as myself and as root. The install succeeded,…
user3063547
  • 739
  • 1
  • 8
  • 18
2
votes
1 answer

Where is imageio finding 'chelsea.png'

I'm working with imageio in Python and the sample code shows a variable "im" reading "chelsea.png" but that file doesn't exist on my machine anywhere. import imageio as iio im = iio.imread('imageio:chelsea.png') print(im.shape) The output…
Bruce Seymour
  • 1,520
  • 16
  • 24
2
votes
1 answer

Saving a NumPy array with imageio.imsave distorts the image

I am processing an image with imageio library in Python, and I got unexpected result. I tested the problem with the code below: import imageio import numpy as np imgarray = np.zeros((3, 4032, 3024), dtype=np.uint8) imgarray[0, 0::2, 1::2] =…
AABBCC
  • 77
  • 2
  • 8
2
votes
1 answer

Correctly Load Binary Mask/GIF with PIL and Imageio

I have to load a gif containing a binary mask in Python. import numpy as np from PIL import Image import imageio from matplotlib import pyplot as plt maskPIL = np.array(Image.open('mask.gif')) maskIO =…
Mr Vinagi
  • 390
  • 3
  • 12
2
votes
1 answer

How to create histograms in pure Python?

I know you can just use numpy.histogram(), and that will create the histogram for a respective image. What I don't understand is, how to create histograms without using that function. Everytime I try to use sample code, it has issues with packages…
2
votes
2 answers

How to return a numpy array as an image using FastAPI?

I load an image with img = imageio.imread('hello.jpg'). I want to return this numpy array as an image. I know I can do return FileResponse('hello.jpg'), however, in the future, I will have the pictures as numpy arrays. How can I return the numpy…
Skyy2010
  • 795
  • 7
  • 19
2
votes
1 answer

How to use imageio imread to get a multi channel array (RGB) from a single channel image (grayscale)?

So I want to use imageio to read a black-and-white image as a 3d image. If I had used opencv I would use the following command since opencv's default is IMREAD_COLOR: im3d = cv2.imread(im_path) This results in shape (186, 148, 3) However, since it…
Henrik Leijon
  • 1,277
  • 2
  • 10
  • 15
2
votes
0 answers

Python: Detect a rare strange GIF when extracting its frames

I have collected a large-scale datasets of gifs(more than 100k) from the Internet, and I meet some rare strange GIFs when I try to extract frames of GIFs with python. Three common used packages(moviepy, PIL, imageio) provide totally different…
jianjieluo
  • 319
  • 1
  • 4
  • 15
2
votes
1 answer

imageio - ValueError: Could not find a format to read the specified file in mode 'i'

I have a series of SVG images (generated from matplotlib) and I want to combine them into a GIF image. Since I read this question, I tried imageio, but it raised ValueError: Could not find a format to read the specified file in mode 'i' at…
xiaoyu2006
  • 507
  • 7
  • 20
1 2
3
12 13