The demo images in README file is stolen from ICS Lab, you can find the original post here.
Private mac os framework code#
I patched it for APNG supporting based on code in this project. AcknowledgementĪPNGKit is built on top of a modified version of libpng. There is a plan to extend this framework to export and write APNG files from separated PNG files as frames.Īnd maybe some callbacks of APNG animation playing or even more controlling of playing will be added later as well. TODOĬurrently APNGKit can only load and display APNG files or data. A suggested extension is "apng", which will be detected and handled by APNGKit seamlessly. If you do so, Xcode will stop recognizing your APNG files as PNG format, and will not apply compression on them. However, it will also prevent Xcode to optimize your other regular PNGs.Ī better approach would be renaming your APNG files with an extension besides of "png". You can disable the PNG compression by setting "COMPRESS_PNG_FILES" to NO in the build settings of your app target. Since APNG is an extension format of PNG, Xcode will think there are redundancy data in that file and compress it into a single static image. Xcode will compress all PNG files in your app bundle when you build the project. But it should be rare, so if you are not sure about it, just leave APNGKit to manage the cache itself. It will be useful sometimes since there is a chance that your app will crash before a memory warning could be received when you alloc a huge amount of memory.
Private mac os framework install#
You can install it with the following command:ĪPNGCache. CocoaPodsĬocoaPods is a dependency manager for Cocoa projects.ĬocoaPods 0.36 adds supports for Swift and embedded frameworks. If you are still using Xcode 8, try version 0.6.4 instead. The latest versions (1.x) supports from Xcode 9 (Swift 3.2 or Swift 4).
Installation RequirementĪlthough it is written in Swift, the compatibility with Objective-C is also considered. Not only in the browsers world, but also in the apps we always love. The more APNG is used, the more recognition and support it will get. Microsoft Edge and Chrome are also considering adding APNG support since it is already officially added in WebKit core.ĪPNG is such a nice format to bring users much better experience of animating images. Apple recently supported APNG in both desktop and mobile Safari. There is only one "popular" browser called Konqueror(at least I have used it before when I was in high school) that supports MNG, which is really a sad but reasonable story.Įven though APNG is not accepted currently, we continue to see the widespread implementation of it. It is so complex that despite being a "standard", it was almost universally rejected. It is a comprehensive format, but very very very (重要的事要说三遍) complex. There is another format called MNG (Multiple-image Network Graphics), which is created by the same team as PNG. However, it is accepted by many vendors and is even mentioned in W3C Standards. But unfortunately, it is a rebel format so that it is not accepted by the PNG group. Good question! APNG is an excellent extension for regular PNG, and it is also very simple to use and not conflicting with current PNG standard (It consists a standard PNG header, so if your platform does not support APNG, it will be recognized as a normal PNG with its first frame being displayed as a static image). APNG is much better! But wait.why haven't I heard about APNG before? It is not a popular format, so why should I use it in my next great iOS/macOS app? You can click on the image to see how it looks like when animating. At the same time, the file size is comparable to or even less than, if created carefully, GIFs. This means much better quality of animation. It allows for animated PNG files that work similarly to animated GIF files, while supporting 24-bit images and 8-bit transparency not available for GIFs.
Private mac os framework portable#
The Animated Portable Network Graphics (APNG) is a file format extending the well-known PNG format. Since be that, you will feel at home and joy when using APNGKit to play with images in APNG format. High-level abstractions of Cocoa Touch is used for a delightful API. It's built on top of a modified version of libpng with APNG support and written in Swift. APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS.