Skip to content

APNG frames are cut off when saving #6672

@BootsManOut

Description

@BootsManOut

When exporting animated PNG files as APNG, based of a PNG image sequence, it cuts 2 frames in half.

Here is the code I use:

import PIL
from PIL import Image as Img
from os import walk

mypath="original character folder"

#import files:
files = []
for (dirpath, dirnames, filenames) in walk(mypath):
    files.extend(filenames)
    break
#import as PIL image:
images = []
for f in files:
    images.append(Img.open(mypath+"/"+f))

#Export as APNG:
images[0].save("exportfolder/exportimage.apng", disposal=2, save_all=True,
                                      append_images=images[1:], loop=0,
                                      duration=200, optimize=False, lossless=True)

The original images contain all frames. When exported as gif you can see all frames:
characters animation

And this is what it looks like exported as animated APNG:
exportimage animation

Here you can use this folders and place them in the project folder to test it out:
original character folder and export folder containing apng export file.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions