Hi all, i’ve recently released version 1.0.0 of Swift JPEG, a cross-platform pure-swift JPEG codec. The framework has no external dependencies, including on Foundation, so the core library should work on all Swift platforms. In addition, it has built-in file-system support on MacOS and Linux.
The library supports baseline, extended, and progressive-mode images, images with restart markers and DNL segments, and allows users to define their own color-space extensions to the JPEG format. Future work should mainly center on improving performance. It is also a long-term goal to update my related Swift PNG library to match the Swift JPEG API, as i have learned a lot about library design since releasing Swift PNG two years ago. It is available under the Mozilla Public License 2.0.
The Swift JPEG framework emphasizes flexibility and progressive disclosure so it provides interfaces at different levels of image format abstraction. I’ve written several tutorials and example programs going over how to use the framework to accomplish several common image-processing tasks:
- basic decoding (sources)
- basic encoding (sources)
- advanced decoding (sources)
- advanced encoding (sources)
- using in-memory images (sources)
- online decoding (sources)
- requantizing images (sources)
- lossless rotations (sources)
- custom color formats (sources)
Swift JPEG also has something that’s been missing from many Swift projects so far (because the tool that generates the standard library docs is private), which is an apple-style API documentation website. It is organized by topic, differentiates standard-library symbols from module symbols and type parameters, and indicates type relationships.
Right now, i am mainly looking for feedback on the kind of features that are most useful to Swift image codec users, and what areas people feel like UIImage is lacking in that regard. Help with testing and reviewing the generated API docs is also highly welcome. If you could please give it a star on github i would really appreciate that too!