Skip to Content
High Performance Images
book

High Performance Images

by Colin Bendell, Tim Kadlec, Yoav Weiss, Guy Podjarny, Nick Doyle, Mike McCall
November 2016
Intermediate to advanced
354 pages
8h 39m
English
O'Reilly Media, Inc.
Content preview from High Performance Images

Chapter 9. Image Processing

So far in this book, we’ve spent a lot of time discussing the performance impact of images in terms of requests and file size—characteristics that primarily impact the network side of things. However, there’s much more work being done under the hood by the browser to get an image to be displayed on a screen. These additional steps in the image loading process can have a significant impact on the processing time and memory footprint of your site.

Decoding

As we saw in Chapters 2 and 3, when your graphic editor of choice creates the image file, it goes through a series of steps collectively called the encoding process. Consider the general steps included in the JPEG encoding process that we learned about in Chapter 4:

  1. The graphic editor must covert RGB data to the YCbCr format.

  2. The graphic editor applies some level of chroma subsampling to reduce file size.

  3. The input is transformed from the color space to the frequency space by a Discrete Cosine Transformation (DCT) and further optimized using a quantization matrix.

  4. Finally, the data goes through one last lossless compression step called Huffman encoding.

By the end of this process, the original color data has been transformed into a highly compressed bitmap. While this outputted format is exactly what we need to save the file efficiently, it’s not what the browser needs. The browser needs that color data—it needs to know what to actually paint for each pixel on the screen. Specifically, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Optimizing images

Optimizing images

Lara Callender Hogan
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Responsive & Fast

Responsive & Fast

Guy Podjarny
Image Processing and Acquisition using Python, 2nd Edition

Image Processing and Acquisition using Python, 2nd Edition

Ravishankar Chityala, Sridevi Pudipeddi

Publisher Resources

ISBN: 9781491925799Errata Page