You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toy code to reproduce the issue (tested on both linux and osx):
# webp writer writes 0 bytes to BytesIO withio.BytesIO() asbio:
im_rgb=imageio.imread('src_input.jpg')
withimageio.get_writer(bio, format='webp', mode='i') aswriter: # doesn't work for webp.writer.append_data(im_rgb)
data=bio.getvalue()
print(len(data)) # always return 0 here for 'webp' (but it is fine for jpg, png, ect)
Could you try format='targa-FI'? That would also use the default FreeImage plugin. Maybe it helps to determine where it goes wrong. I don't seem to be able to write webp on Windows.
You can also write multiple frames (like a GIF), but then you have to explicitly supply a duration (pillow doesn't offer a default, so we don't set one either):
Activity
almarklein commentedon Jan 13, 2020
Could you try
format='targa-FI'? That would also use the default FreeImage plugin. Maybe it helps to determine where it goes wrong. I don't seem to be able to writewebpon Windows.FirefoxMetzger commentedon Feb 11, 2022
Pillow is perfectly happy to read and write WEBP, so we are too:
You can also write multiple frames (like a GIF), but then you have to explicitly supply a duration (pillow doesn't offer a default, so we don't set one either):