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 how the image is produced inside the source code and the issue seems to be coming from PIL.
from PIL import Image
import imageio
import numpy as np
import matplotlib.pyplot as plt
outdir = r"where/you/want/it/to/go.gif"
frames = np.round(100+20*np.random.randn(10, 40, 40)).astype(np.uint8)
# Create single gif frame with PIL
im = Image.fromarray(frames[0])
im.save(outdir)
# Create gif with imageio
imageio.mimsave(outdir, frames)
I want a GIF that looks like the image on top (no interpolation) which I produced with matplotlib
. The image on the bottom is a single frame produced using imageio
.