python-imageio

skimage/imageio fails to read grayscale images

skimage/imageio fails to read grayscale images Question: I have been reading images using (Python) skimage.imread (or imageio.imread) for months successfully, but now, without changing the code, I get failures when reading grayscale images. My collaborators can read the files. The image properties are: identify test/resources/biosynth1_cropped/text_removed.png test/resources/biosynth1_cropped/text_removed.png PNG 1512×315 1512×315+0+0 8-bit sRGB 48c 10094B 0.000u 0:00.005 …

Total answers: 1

Fast way to convert string to numpy ndarray

Fast way to convert string to numpy ndarray Question: 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 …

Total answers: 2

How to get video metadata from bytes using imageio.v3?

How to get video metadata from bytes using imageio.v3? Question: I am creating a python class to process videos received from a http post. The videos can be from a wide range of sizes, 10 seconds up to 10 hours. I am looking for a way to get video metadata such as fps, height, width …

Total answers: 1

How do I connect two GIFs to play one after another in Python?

How do I connect two GIFs to play one after another in Python? Question: 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 …

Total answers: 3

List to numpy array to write with imageio as video

List to numpy array to write with imageio as video Question: I have a list as all_frames. I want to write this as a video with imageio but I got the error that you can find in below. How can I change all_frame from list to np.array? You can find imageio code in below: all_frames …

Total answers: 1

How to seek a frame in video using `imageio`?

How to seek a frame in video using `imageio`? Question: I have a video and I would like to extract only specific frames from the video. Currently what I do is: index = [1,2,3,4,5,6,7,8] img_list = [] for i, frame in enumerate(iio.imiter("imageio:cockatoo.mp4")): if i in index: img_list.append(frame) img_array = np.asarray(img_list) Is there a way to …

Total answers: 1

Combine all tiff images into one single image

Combine all tiff images into one single image Question: I have 15 tiles or tiff files a folder and I would like combine it as a single file with all the images as one tiff image. All the tiles should be stitched as a single tiff image. How do I do that? What I tried …

Total answers: 5

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

How to return a numpy array as an image using FastAPI? Question: 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 …

Total answers: 2

making gif from images using imageio in python

making gif from images using imageio in python Question: I have tried reading a lot of examples online and found imageio is the perfect package for it. Also found examples written in here. I have just followed the example as shown and tried the following import imageio as io import os file_names = sorted((fn for …

Total answers: 2