Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Facebook Open-Sources 'Spectrum' Image Optimizer To Benefit Users And Developers

Smartphones don't just get bigger. With people taking more and more photos, smartphone vendors are trying to make cameras as one of their main selling points.

With their way-beyond-10 megapixel cameras and multiple sensors, they can snap bigger and more richer photos. Add that with some AI-powered software, competition is tight.

However, these smartphones may not have massive storage to start with.

With an increasing number of megabytes needed to occupy, storage is one problem. The next, is the process of uploading them.

Large image files not only consume more storage space on users' device, they also consume more network bandwidth when shared online. This is one main reason why mobile apps tend to compress images before uploading them.

Apps like these can automatically resize and reformat photos, ensuring minimal lag during upload, with a trade-off in terms of image quality.

For example, a 5MB picture could be roughly a fifth of that size when displayed in the app, which means significant reduced clarity.

Sending high-resolution images is often wasteful, as content delivery network (CDN) will resize the image for the recipient (image courtesy: Facebook)

To ensure that people can upload these huge pictures to the internet without mush of a hassle, Facebook steps in by providing a solution.

It's called 'Spectrum', an open-source software which is essentially an image processing library for Android and iOS.

The software aims to improve the reliability of image uploads, while simultaneously making them less demanding on users' data plan.

With Spectrum, Facebook aims to ensure maximum quality without compromising on the upload experience.

Facebook also wants Spectrum to become the one-stop-shop for users to perform image-manipulation tasks essential to lowering file-sizes and improving reliability - like cropping, resizing, and transcoding.

Here, the client-side image image transcoding library works by reducing the file size, which in turn means faster uploads and less mobile data consumption. Then, it uses a "declarative" API to make it easier for app developers to control the image quality without having to worry about the individual steps required to get there.

What this means, Spectrum doesn’t require developers to manually define all behaviors step-by-step. Instead, they are only required to state what their desired outcome is, and the library can take it from there.

To make this possible, Spectrum uses what it called “recipes.”

These recipes are bundled with the plugins used by the library, and sorted by Facebook to prioritize the most efficient ones. So, for example, the JPEG plugin will include several recipes designed to specifically process JPEG files.

Resizing the image on the sender’s device reduces the bandwidth required to send the image. This reduces payload overhead, improving the end-to-end experience (image courtesy: Facebook)

According to Facebook, Spectrum prefers a lossless approach when cropping and rotating JPEG images. While resizing images, the software "optimizes the interplay between decoder sampling and pixel-perfect resizing."

Spectrum also integrates with native image compression libraries, including MozJpeg, a JPEG encoder from Mozilla, which can reduce a file size by 10-15 percent before uploading. It also supports "more advanced parameters," such as chroma subsampling, which is a compression practice that attributes less resolution to an image’s color in favor of luminance data.

With certain images that need more defined colors, like those with sharp edges or illustrations, Spectrum can also intervene.

Facebook isn't exactly known for fantastic image compression. Regular Facebook users should know this when upload pictures, and see the results can be far from expectation. But as for Spectrum, the social media has been using it in-house across its collection of mobile apps.

The social networking giant first unveiled Spectrum to the public in November, and it has been available in beta since that time.

On January 17th, 2019, the company unveiled Spectrum at the droidcon SF conference, and officially launched Spectrum 1.0.0 on GitHub, as the company strives to improve the technology by opening it to the developer community.

While the core of Spectrum is written in C++, Facebook has also released Java and Objective-C APIs in order to make it easier for developers to use the tool.

Published: 
18/01/2019
News
Facebook
Mobile
Developers
Trends
Review


This post first appeared on Eyerys | Eyes For Solution, please read the originial post: here

Share the post

Facebook Open-Sources 'Spectrum' Image Optimizer To Benefit Users And Developers

×

Subscribe to Eyerys | Eyes For Solution

Get updates delivered right to your inbox!

Thank you for your subscription

×