1

The below code is using ImageMagik to decode a webp and save it into a .gif, when using the trackbar to scroll through the frames, why do have white squares or part of the image that appears to be not rendered properly?

edit: it looks as though the broken images are rendering only what has 'changed' since the previous frame rather than rendering everything, if that makes it any clearer.

internal class ImageIO {
    
    public Img img = new Img();
    
    /// <summary>
    ///     Update PictureBox with new image
    /// </summary>
    /// <param name="pb">PictureBox Gadget</param>
    /// <param name="frame">int frame</param>
    /// <remarks>This function is not 'safe' as you can pass any arbitrary int frame value even
    /// if it is out of range.</remarks>
    public void UpdateAnimation(PictureBox pb, int frame) {
        var fr = img.cImgCollection[frame];
        pb.Image = fr.ToBitmap();            
    }    
}
Melony Sharon
  • 91
  • 3
  • 10

1 Answers1

0

The problem was deeper in the loading code, turns out that this was the problem;

imagemagick leaves artifacts in gif to jpg list conversion

and it was fixed by adding;

webpcollection.Coalesce();
Melony Sharon
  • 91
  • 3
  • 10