Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APNG Loading #797

Merged
merged 9 commits into from
Dec 23, 2022
Merged

Conversation

20kdc
Copy link
Contributor

@20kdc 20kdc commented Dec 22, 2022

This adds an APNG loader. Loaded APNGs are treated as opened projects right now, as importing them "as an image" doesn't really make sense.

Due to the "APNGs are subsets of PNGs" rule, an APNG will only be considered as such if it contains at least one APNG frame (which makes it distinct from a regular unanimated PNG).

On the previous PR regarding APNG, #772 @luiq54 mentioned as so:

Hello! I request you to move this code into an Godot addon so that it can be maintained independently from Pixelorama and will also help other Godot Projects! You can reference the GIF exporter addon as template.

With the addition of an APNG loader that shares quite a bit of common code with the saver (due to the nature of the technique used to load APNG efficiently with very little code), this has become rather important.

With the original APNG saver this was unnecessary as it was a single file in size, but that has now changed.

As such, I have refactored my APNG saver into an addon, and included an APNG loader.

The GIF exporter integration code still remains in Pixelorama (that part of the structure exists to keep the code clean more than anything else).

My addon is licensed under the Unlicense as it has been recommended to me as a better license for code than CC0 (due to Fedora policies and so forth).

I would recommend Pixelorama doesn't consider upstreaming to be much of a requirement for changes to the addon, my addon doesn't have much in the way of support guarantees, it only exists in this form because it's a good point that having it like this helps other Godot projects.

The following file loads in Pixelorama with this PR:
import_demo

Notably, this doesn't include a GIF importer, but it does provide a useful path to import a GIF in that ffmpeg is capable of converting a GIF to an APNG (previously there was no way to import a GIF at all that I'm aware of without somehow getting it into a spritesheet).

Also notably, the addon may be of use for future animated splash screens, as it is capable of importing an APNG as an AnimatedTexture.

Copy link
Member

@OverloadedOrama OverloadedOrama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Great job, thank you!

@OverloadedOrama OverloadedOrama merged commit 4658b1c into Orama-Interactive:master Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants