Skip to content

Commit

Permalink
Update data
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed Sep 7, 2024
1 parent 813a5b5 commit 65d7c67
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blog/webp-the-webpage-compression-format/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blog/webp-the-webpage-compression-format/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ The bright part on the very top and the very bottom is text and code. The hatche

The really bright pixels throughout text? Those are Unicode characters, mostly punctuation like the apostrophe and the ellipsis.

The actual savings here are unfortunately quite moderate: the original is `87 KiB` after gzip, the WebP one is `82 KiB` after gzip. In contrast, brotli would provide `69 KiB`. Better than nothing, though.
The actual savings here are unfortunately quite moderate: the original is `87 KiB` after gzip, the WebP one is `83 KiB` after gzip. In contrast, brotli would provide `69 KiB`. Better than nothing, though.

Also, hey, it's fun. I like having fun.

Expand Down
2 changes: 1 addition & 1 deletion blog/webp-the-webpage-compression-format/nojs.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<span class="hljs-meta prompt_">
$ </span><span class=language-bash><span class=hljs-built_in>base64</span> -w0 compressed.webp | gzip --best | <span class=hljs-built_in>wc</span> -c</span>
43519
</code></pre><p>Why? Well, WebP, being a compressed blob, is almost uniformly random, a property retained after base64, the 8-bit-to-6-bit transform. The Huffman tree generated by gzip, applied to uniformly random data, effectively provides an inverse 6-bit-to-8-bit transform.<p>We could use Unicode and UTF-16, but sometimes the first solution is simply the right one.<p class=next-group><span aria-level=3 class=side-header role=heading><span>Example</span></span>A real-world web page compressed with WebP? Oh, how about the one you’re reading right now? Unless you’re using a really old browser or have JavaScript turned off, WebP is used to compress this page starting from the “Fool me twice” section. If you haven’t noticed this, I’m happy the trick is working :-)<p>Oh, and if you want to know what the WebP looks like? Here’s a square WebP of this page:<p><div class=diagram><img alt="This page in WebP format"src=this-page.webp></div><p>The WebP I actually use is tall and narrow, but this one makes for a better view.<p>The bright part on the very top and the very bottom is text and code. The hatched one at about 1/5 is the diagram. The dark part, taking most of the page, is the <em>text</em> on the diagram. (Yes, really! It doesn’t use a font.)<p>The really bright pixels throughout text? Those are Unicode characters, mostly punctuation like the apostrophe and the ellipsis.<p>The actual savings here are unfortunately quite moderate: the original is <code>87 KiB</code> after gzip, the WebP one is <code>82 KiB</code> after gzip. In contrast, brotli would provide <code>69 KiB</code>. Better than nothing, though.<p>Also, hey, it’s fun. I like having fun.<p class=next-group><span aria-level=3 class=side-header role=heading><span>Links</span></span>Rust code, the corpus and various other files are available <a href=https://github.com/purplesyringa/site/tree/master/blog/webp-the-webpage-compression-format>on GitHub</a>. Join the discussion on Reddit if you feel like it.</div></section><footer><div class=viewport-container><h2>Made with my own bare hands (why.)</h2></div></footer><script>window.addEventListener("keydown", e => {
</code></pre><p>Why? Well, WebP, being a compressed blob, is almost uniformly random, a property retained after base64, the 8-bit-to-6-bit transform. The Huffman tree generated by gzip, applied to uniformly random data, effectively provides an inverse 6-bit-to-8-bit transform.<p>We could use Unicode and UTF-16, but sometimes the first solution is simply the right one.<p class=next-group><span aria-level=3 class=side-header role=heading><span>Example</span></span>A real-world web page compressed with WebP? Oh, how about the one you’re reading right now? Unless you’re using a really old browser or have JavaScript turned off, WebP is used to compress this page starting from the “Fool me twice” section. If you haven’t noticed this, I’m happy the trick is working :-)<p>Oh, and if you want to know what the WebP looks like? Here’s a square WebP of this page:<p><div class=diagram><img alt="This page in WebP format"src=this-page.webp></div><p>The WebP I actually use is tall and narrow, but this one makes for a better view.<p>The bright part on the very top and the very bottom is text and code. The hatched one at about 1/5 is the diagram. The dark part, taking most of the page, is the <em>text</em> on the diagram. (Yes, really! It doesn’t use a font.)<p>The really bright pixels throughout text? Those are Unicode characters, mostly punctuation like the apostrophe and the ellipsis.<p>The actual savings here are unfortunately quite moderate: the original is <code>87 KiB</code> after gzip, the WebP one is <code>83 KiB</code> after gzip. In contrast, brotli would provide <code>69 KiB</code>. Better than nothing, though.<p>Also, hey, it’s fun. I like having fun.<p class=next-group><span aria-level=3 class=side-header role=heading><span>Links</span></span>Rust code, the corpus and various other files are available <a href=https://github.com/purplesyringa/site/tree/master/blog/webp-the-webpage-compression-format>on GitHub</a>. Join the discussion on Reddit if you feel like it.</div></section><footer><div class=viewport-container><h2>Made with my own bare hands (why.)</h2></div></footer><script>window.addEventListener("keydown", e => {
if (e.key === "Enter") {
if (e.ctrlKey) {
window.open("https://github.com/purplesyringa/site/edit/master/blog/webp-the-webpage-compression-format/index.md", "_blank");
Expand Down
Binary file modified blog/webp-the-webpage-compression-format/this-page.webp
Binary file not shown.

0 comments on commit 65d7c67

Please sign in to comment.