Scribusoid

Author Topic: [Feature] Support of animated png (*.apng)  (Read 157 times)

Templina

  • Guest
[Feature] Support of animated png (*.apng)
« on: July 19, 2018, 05:05:23 am »
Regarding pdf-export (logically for the web/ monitor view in the first place), it would be nice if Scribus supports the animated png (*.apng) file format.

My main reason to put it in discussion here and not simply in the bugtracker is that this might need clarification by someone more proficient with the pdf standard: Is it actually possible to include animated png?

This request has been discussed a few times on StackOverflow etc., often with a link to a proprietary layout software or with the argument of not being doable. Opensource reader applications do not support this format yet, but they might. For example, Evince has such extended multimedia support on it's roadmap yet first would need a pdf with an apng successfully embedded. Okular already has video support afaik.

To give possible usecases, it could be used in even more sophisticated presentations using pdf, e.g. explosion diagrams in industrial engineeering.
Personally, I'd like to use it in creating Chooseable-Path-adventure books with animated images (CYOA with apng-images).

Thank you for reading and your interest.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1492
  • Karma: 20
    • the graphics lab
Re: [Feature] Support of animated png (*.apng)
« Reply #1 on: July 19, 2018, 09:58:07 am »
hi templina

the pdf standard does not seem to support animated images.
which is fine, since PDF has been created for the print workflow...
(and i'm more and more convinced that PDF should stick to that and there are better formats for distributing digital content!)

and even if PDF would allow animated PNG:
scribus is a DTP program which (for now) is focused on the print workflow.
i guess it's the wrong program to be the first to add support for the apng format.

if you want something for creating a pdf that can be used for testing the pdf reader, i guess it would be better to go for a fpdf plugin...

ciao
a.l.e

dragonfly

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 0
  • Scribus User
Re: [Feature] Support of animated png (*.apng)
« Reply #2 on: July 20, 2018, 09:11:11 pm »
I confess that on reading this thread I was unaware of CYOA publications and apng but after some reading I now have a better understanding.

Since I am experimenting with Scribus to create
(a) static document (standard approach by Scribus)
(b) interactive document (web based)
I decided to explore this feature request further to "proof of concept" stage.

I am not developing CYOA books but I do see a requirement for Scribus presentations and customisations driven by external variables.

...

Starting with gaining an understanding of the basics of CYOA these sites offer insights ...

https://news.ycombinator.com/item?id=14558106

http://samizdat.co/cyoa/

As @ale explained above, Scribus is designed to publish a single static publication.  However as I explain below that primary goal does not prevent Scribus being used for publishing interactive presentations to complement the printed document.

CYOA as I understand requires decisions to be taken and rules to be followed throughout the course of reading through a labrynth.

Scribus does provide some native functionality for interactively jumping to different pages based on the reader's decisions. If you click on PDF options you can add a button on a page (perhaps at the end of a chapter) to jump to a specified page.   However this will be difficult to manage as more “CYOA forks” are added to the publication.  It might make sense to automate the introduction of such links according to a table (perhaps automatically adding the page jump according to an external csv file).   I did not explore this route since it is not easy to automate.

...

Regarding apng creation I found a few interesting sites.

This is an online apng creator which I used to create a test apng file.

https://ezgif.com/apng-maker/

And here is a python package to create apng.

https://pypi.org/project/apng/

This site shows which browsers support apng.

https://caniuse.com/#search=apng

...

On dropping a pre-prepared apng image into a Scribus document imageframe and exporting as PDF, the animation is not seen.

How then can we leverage Scribus to show such animation?

I found the solution is to  Export Scribus document as SVG and not PDF.

Save Images Inline option must be unticked so that the apng image is an external image.

The svg file is then embedded in an html file to provide the animation.

The OP refers to using PDF readers such as Evince and Okular so it appears to be accepted that a reader is required.   For the interactive version of the Export (svg format) we can build a widget to display the SVG file in an html wrapper.

...

Now having built a rough proof of concept that *.apng can be embedded I will now argue that this is not necessary since SVG can be edited to be interactive.

Thus for all the animated forks required in a CYOA project I would focus only on SVG objects.

To achieve a CYOA build environment some graph theory needs to be leveraged. This is illustrated here.

https://twitter.com/rmodjeski/status/455184159401472000

...

I have yet to develop these ideas further.   They expand on my idea to build a storyboard as I discussed here.

http://forums.scribus.net/index.php/topic,3000.msg13984.html#new

Conclusion: SVG rules.

Templina

  • Guest
Re: [Feature] Support of animated png (*.apng)
« Reply #3 on: July 29, 2018, 04:39:51 pm »
Thanks for both your answer!

Closing this thread now.