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.
Questions tagged [python-imageio]
191 questions
2
votes
1 answer
Save individual segments from image segmentation
I've been using skimage.segmentation modules to find contiguous segments within an image.
For example,
segments quite nicely to
I want to be able to view the distinct regions of the original image in isolation (such that the above image would…

user6118986
- 341
- 2
- 15
2
votes
2 answers
Write additionnals images in a tiff file without erasing existing images
What I'm actually doing is saving images in a tiff file, using imageio.mimwrite(). But in my script, I open and close the file several times, so it erases existing images before saving news images. I want to keep existing images in the tiff file,…

Biopy
- 167
- 1
- 5
- 15
2
votes
1 answer
Visualizing executable byte stream to a image file, why it is rotated 45 degrees?
I'm trying to visualize malware executables for testing visual classification approach. Using Microsoft Malware Classification Challange dataset .bytes files I have input such:
00401000 56 8D 44 24 08 50 8B F1 E8 1C 1B 00 00 C7 06 08
00401010 BB 42…
2
votes
2 answers
how to to tackle OverflowError: cannot convert float infinity to integer
I am trying to read the frames using imageio API. I have a reader as an object which I have received using imageio.get_reader(video_path,"ffmpeg")
nframes =int(reader.get_length())
for ii in range(nframes):
while frame_q.qsize() > 500: # so…

Sam
- 352
- 2
- 4
- 22
2
votes
2 answers
Image Card detection using python
I want to detect how many number of cards are present in this image using python.I was trying with white pixel but not getting the correct result.
My code is given below:
import cv2
import numpy as np
img = cv2.imread('imaagi.jpg',…

Shaon Paul
- 153
- 1
- 2
- 14
2
votes
0 answers
Video is black when framerate is too low using imageio and Python
I have the following exmaple code:
import numpy as np
writer = imageio.get_writer('test.mp4', fps=1)
max = 800
resolution = 256
for idx in range(1, max):
img = np.zeros((resolution,resolution))
img[: int((idx / max) * resolution), :…

palimboa
- 171
- 10
2
votes
0 answers
error when running "imageio.plugins.ffmpeg.download()"
I am trying to run the command imageio.plugins.ffmpeg.download() after installing moviepy and imageio and importing imageio without error.
I keep getting the following error and cannot figure out the solution:
Imageio: 'ffmpeg-osx-v3.2.4' was not…

Maryeveh
- 21
- 1
2
votes
0 answers
How to load an JPEG XR image file in Python
I have some images in the JPEG XR format (file endings ".wdp" & ".jxr") and want to load them in Python. I had to do quite some research since the format seems to be rather"exotic".
I finally found some clues that ImageIo seems to have support for…

Asgarod
- 21
- 6
2
votes
2 answers
Cannot reshape array using imageio. Why?
I'm trying to mimic what this line of code does, using imageio :
img_array = scipy.misc.imread('/Users/user/Desktop/IMG_5.png', flatten=True)
img_data = 255.0 - img_array.reshape(784)`
However when using imageio I get:
img =…

Bn.F76
- 783
- 2
- 12
- 30
2
votes
0 answers
python imageIO() ffmpeg output 3D ndarray
I'm trying to encode and than decode a collection of images using imageIO in python with the ffmpeg plugin and the HEVC codec.
The stream I'm using is an ndarray of shape (1024,512). When I use the writer.append_data() on each image, the shape is as…

Daimoj
- 21
- 1
1
vote
0 answers
How to properly read .exr file and save it to .flo?
Firstly, I want to explain step by step what I am trying to do:
I have game motion vectors stored in .exr file (have no information about pixel format, likely float32), however I am provided with function that decodes velocity.
I want to save them…

szefitoo
- 99
- 6
1
vote
1 answer
How to grab video frames fast?
For my project I want to extract frames from a video to make thumbnails. However every method i find is super slow going through the entere video. Here is what I have tried:
with iio.imopen(v.file.path, "r") as vObj:
metadata =…

JasonTS
- 2,479
- 4
- 32
- 48
1
vote
0 answers
imageio get_data skips frames
For a viewer, I am trying to randomly access frame in an mp4 file. Unfortunately, depending on where I start off, I am getting different frames from the same index, in my case for any frame after frame 123:
import imageio
import hashlib
from tqdm…

mcandril
- 356
- 5
- 13
1
vote
2 answers
Optimize conversion of numpy ndarray to string
I am currently doing a python program to convert from image to hex string and the other way around. I need two functions, one that takes an image and returns a hex string that corresponds to the RGB values of each pixel, and another function that…

Rararat
- 53
- 6
1
vote
3 answers
How do I connect two GIFs to play one after another in Python?
If I have two GIFs, GIF 1 being 10 seconds long and GIF 2 being 5 seconds long, is there a way to connect them so the final GIF is a total of 15 seconds long?
Would I have to loop through each frame of both the GIFs with imageio.mimread() and…

Andrew
- 507
- 5
- 16