To make the upload process of images captured by modern smart phones more efficient, Facebook developed an image processing library for Android and iOS called Spectrum.
With the release of Spectrum, the image upload quality and reliability can be improved. It is a cross-platform image library that can be integrated into an Android device or iOS device easily
Spectrum 1.0.0 was officially released to GitHub which helps the users to efficiently perform common image operations. It uses a “declarative” API allows developers to focus on the desired output properties.
The code for Spectrum is written in C++ that provides greater control over allocations and enables higher execution speed for computational operations. Higher performance with Java and Objective-C wrapper APIs around the C++ core makes development easier.
Facebook mobile software engineer Daniel Hugenroth said, “We hope Spectrum will benefit developers in the same way it has helped Facebook create a better image production experience. In our apps, Spectrum has improved the reliability and quality of image uploads at large scale across our apps.”
Spectrum includes native libraries like MozJpeg. It allows the Spectrum to control encoding parameters beyond the general purpose platform APIs. It makes easier for user to upload images and can significantly reduces the file size of the.
It enables the users to control advanced parameters like chroma subsampling to improve the quality of images with sharp edges and illustrations
It does not require developers to define all behaviour manually step-by-step. Rather, the developers can just define what the desired outcome is, and the library takes it from there.
It makes this possible by using “recipes”, a bundle of plugins used by the library. These are sorted by Facebook . For example, the JPEG plugin will include recipes that are specifically designed to process cropping and rotation of JPEG images.