2

I have 50 PNGs (like those ones here) and I would like to create a GIF (or APNG) animation from it that approximately retains the quality and is small.

What I'm doing so far is to rescale and throw optipng at them:

for file in step*.png; do \
  convert -trim -resize 200x200 $$file png8:$$file; \
  optipng -quiet $$file; \
done

After this, the size of the individual PNGs is about 30KB. (Perhaps more can be tuned here.) Then it's conversion time:

$ apngasm out.png step*.png

The output file, however, still clocks in at a whopping 1.3 MB.

                                                    enter image description here

Any idea of how to improve this?

  • 2
    What about dropping the number of colors to 2? -colorspace gray -colors 2 or something. At 400x400; 2 color the size is about 6.4kb. – jc__ Jul 17 '18 at 18:59
  • Have you investigated if apngasm somehow undoes the optimizations? – dirkt Jul 18 '18 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.