Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're really interested in the technical details, check out the source code: </p> <ul> <li><a href="http://code.google.com/p/page-speed/source/browse/lib/trunk/src/pagespeed/image_compression/png_optimizer.cc" rel="noreferrer">png_optimizer.cc</a></li> <li><a href="http://code.google.com/p/page-speed/source/browse/lib/trunk/src/pagespeed/image_compression/jpeg_optimizer.cc" rel="noreferrer">jpeg_optimizer.cc</a></li> <li><a href="http://code.google.com/p/page-speed/source/browse/lib/trunk/src/pagespeed/image_compression/webp_optimizer.cc" rel="noreferrer">webp_optimizer.cc</a></li> </ul> <hr> <p>For PNG files, they use OptiPNG with some trial-and-error approach</p> <pre class="lang-cpp prettyprint-override"><code>// we use these four combinations because different images seem to benefit from // different parameters and this combination of 4 seems to work best for a large // set of PNGs from the web. const PngCompressParams kPngCompressionParams[] = { PngCompressParams(PNG_ALL_FILTERS, Z_DEFAULT_STRATEGY), PngCompressParams(PNG_ALL_FILTERS, Z_FILTERED), PngCompressParams(PNG_FILTER_NONE, Z_DEFAULT_STRATEGY), PngCompressParams(PNG_FILTER_NONE, Z_FILTERED) }; </code></pre> <p>When all four combinations are applied, the smallest result is kept. Simple as that.</p> <p>(N.B.: The <code>optipng</code> command line tool does that too if you provide <code>-o 2</code> through <code>-o 7</code>)</p> <hr> <p>For JPEG files, they use <a href="http://code.google.com/p/jpeglib/source/browse/" rel="noreferrer">jpeglib</a> with the following options:</p> <pre class="lang-cpp prettyprint-override"><code> JpegCompressionOptions() : progressive(false), retain_color_profile(false), retain_exif_data(false), lossy(false) {} </code></pre> <hr> <p>Similarly, WEBP is compressed using <a href="http://git.chromium.org/gitweb/?p=webm/libwebp.git" rel="noreferrer">libwebp</a> with these options:</p> <pre class="lang-cpp prettyprint-override"><code> WebpConfiguration() : lossless(true), quality(100), method(3), target_size(0), alpha_compression(0), alpha_filtering(1), alpha_quality(100) {} </code></pre> <hr> <p>There is also <a href="http://code.google.com/p/page-speed/source/browse/lib/trunk/src/pagespeed/image_compression/image_converter.cc" rel="noreferrer">image_converter.cc</a> which is used to losslessly convert to the smallest format.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload