Swift PNG 4.0
Swift PNG
4.0.0
features
-
Powerful interfaces. Swift PNG’s expressive, strongly-typed APIs make working with PNG images easy for beginners and advanced users alike. If your code compiles, you’re already most of the way there. Power users can take advantage of custom indexing, manual decoding workflows, and user-defined color targets.
-
Superior compression. Swift PNG supports minimum cost path-based DEFLATE optimization, which is why it offers four additional compression levels beyond what libpng supports. Swift PNG outperforms libpng at its highest compression setting by significant margins for almost all types of input images.
-
Competitive performance. Swift PNG offers competitive performance compared to libpng. On appropriate CPU architectures, the Swift PNG encoder makes use of hardware-accelerated hash tables for even greater performance.
-
Pure Swift, all the way down. Aside from having no external dependencies, Swift PNG is powered by its own, native Swift DEFLATE implementation. This means Swift PNG works on any platform that Swift itself works on. It also means that Swift PNG’s performance improves as the Swift compiler matures.
-
Batteries included. Swift PNG comes with built-in color targets with support for premultiplied alpha. Convolution and deconvolution helper functions make implementing custom color targets a breeze.
On MacOS and Linux, Swift PNG has built-in file system support, allowing you to compress or decompress an image, given a filepath, in a single function call. Other platforms can take advantage of Swift PNG’s protocol-oriented IO to implement their own data loading.
-
First-class iPhone optimization support. Swift PNG requires no custom setup or third-party plugins to handle iPhone-optimized PNG images. iPhone-optimized images just work, on all platforms. Reproduce
pngcrush
’s output with bit width-aware alpha premultiplication, for seamless integration anywhere in your application stack. -
Comprehensive metadata support. Swift PNG can parse and validate all public PNG chunks, which are accessible as strongly-typed metadata records.
-
Modern error handling. Swift PNG has a fully stateless and Swift-native error-handling system.