Inter-frame Optimization in APNG
For our sample animation, we'll take 4 input frames, 150x150 each:
150x150
150x150
150x150
150x150
Then we'll use APNG Assembler to create our animation:
apngasm clock_apng.png clock_input_*.png 1 2 -z2 -i1000
apngasm clock_apng.png clock_input_*.png 1 2 -z2 -i1000
clock_apng.png
150x150
Now let's see how subframes are stored in APNG, using borders to show their position and size:
150x150
73x58
73x66
89x30
Looking at frame data sizes in IDAT and fdAT chunks, it's clear that storing frame differences instead of full frames leads to significant savings in file size: