The technology behind preview photos

Visit the post for more.

Edward Kandrot
8 min readbeginner
--
View Original

Overview

The article discusses the challenges of loading cover photos on Facebook, particularly for users on slow networks. It details the engineering solution that allows a visual impression of images to be created using only 200 bytes, improving user experience significantly.

What You'll Learn

1

How to create a visual impression of images using minimal data

2

Why reducing image size to 200 bytes can enhance loading speed

3

How to implement Gaussian blur for image display

Key Questions Answered

How can Facebook improve image loading times for users on slow networks?
Facebook's engineering team addressed slow image loading by creating a visual impression of cover photos using only 200 bytes. This approach eliminates the need for a second network request, allowing users to see a preview immediately while the full image loads in the background.
What techniques were used to compress images to 200 bytes?
The team experimented with various compression techniques, ultimately leveraging JPEG encoding. By using a fixed header and a custom Huffman table, they managed to fit the image data into the 200-byte limit while maintaining visual fidelity.
What is the significance of the 42x42 pixel resolution in image processing?
The 42x42 pixel resolution was determined to be the lowest necessary for achieving the desired frosted-glass effect when displayed. This resolution balances image quality with the need to compress data effectively to meet the 200-byte target.

Key Statistics & Figures

Improvement in profile and page load speed
30 percent
This improvement was observed for users on slow connections after implementing the new image loading technique.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Backend
Graphql
Used to deliver image data efficiently in the initial network request.
Image Encoding
Jpeg
Utilized for compressing images to fit within the 200-byte limit while maintaining visual quality.

Key Actionable Insights

1
Implementing a visual impression of images can drastically improve user experience on slow networks.
By reducing the initial data load, users can engage with content faster, which is particularly important in developing markets with limited connectivity.
2
Using Gaussian blur can help in creating visually appealing images with reduced data requirements.
This technique allows for effective image display while minimizing the amount of data transmitted, which is crucial for applications targeting users on low-bandwidth connections.
3
Creating a fixed JPEG header can streamline image processing and reduce transmission size.
By standardizing the header, developers can focus on sending only the unique image data, enhancing performance and efficiency in image-heavy applications.

Common Pitfalls

1
Underestimating the impact of image loading times on user experience.
Many developers may not realize how critical fast loading images are, especially in regions with poor connectivity. This can lead to user frustration and decreased engagement.

Related Concepts

Image Compression Techniques
Network Optimization Strategies
User Experience Design