<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CompressDog</title>
    <description>The latest articles on DEV Community by CompressDog (@compressdog).</description>
    <link>https://dev.to/compressdog</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4166444%2Fe958c087-ccf3-417c-9cc6-ba572eeb5119.png</url>
      <title>DEV Community: CompressDog</title>
      <link>https://dev.to/compressdog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/compressdog"/>
    <language>en</language>
    <item>
      <title>I tested five compression claims. Three didn't hold.</title>
      <dc:creator>CompressDog</dc:creator>
      <pubDate>Wed, 11 Nov 2026 17:34:20 +0000</pubDate>
      <link>https://dev.to/compressdog/i-tested-five-compression-claims-three-didnt-hold-4p6g</link>
      <guid>https://dev.to/compressdog/i-tested-five-compression-claims-three-didnt-hold-4p6g</guid>
      <description>&lt;p&gt;Every compressor, including one I built, carries a set of claims in its interface. "Tuned quantisation tables." "Lossless." "Higher quality." I had repeated all five of these without measuring any of them, so I spent a few evenings measuring them on 320 real images with SSIMULACRA2 against the decoded original.&lt;/p&gt;

&lt;p&gt;Three of the five did not survive contact.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "Tuned quantisation tables produce better files"
&lt;/h2&gt;

&lt;p&gt;Mozjpeg ships two sets of tables: baseline, and a "tuned" set that is supposed to be better.&lt;/p&gt;

&lt;p&gt;At quality 90, on the same 320 images, the tuned tables needed &lt;strong&gt;8.3% more bytes&lt;/strong&gt; and scored &lt;strong&gt;0.6 points lower&lt;/strong&gt;. Not a trade-off, a straight loss.&lt;/p&gt;

&lt;p&gt;The reason is visible once you plot the whole curve. The tuned tables are optimised for heavy compression, where blocking artifacts dominate. Below quality 60 they do win. Above it the curves cross and never come back. A preset named "balanced" that is worse on both axes at the quality most people pick is not balanced.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. "Converting between formats is roughly free"
&lt;/h2&gt;

&lt;p&gt;Take a JPEG, encode it to WebP at quality 90, decode it, encode it back to JPEG at 90. Compare that against encoding the original straight to JPEG at 90. Same final format, same quality, same encoder. The only difference is the detour.&lt;/p&gt;

&lt;p&gt;Cost: &lt;strong&gt;8.20 points on average&lt;/strong&gt;, and it was worse on &lt;strong&gt;all 320&lt;/strong&gt; images.&lt;/p&gt;

&lt;p&gt;Meanwhile the WebP really was 32.9% smaller. So WebP is not the problem. The problem is the round trip, and the returned JPEG is 9.4% smaller than the control, which is the part that fools people. It is smaller because there is less in it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. "If a file looks bad, re-save it at higher quality"
&lt;/h2&gt;

&lt;p&gt;This is the one that surprised me. Take a JPEG compressed at quality 45. Re-save it at 90. You would expect recovery, or at best no change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;All 320 images came out slightly worse&lt;/strong&gt;, by 0.43 points on average. And the file went from 96.3 KB to 183.7 KB, which is 90.9% larger, for a result that still sits 20.5 points below a clean encode from the original.&lt;/p&gt;

&lt;p&gt;A quality-45 image is full of compression artifacts. An encoder at quality 90 cannot tell them from detail, so it spends bits reproducing them faithfully, then quantises again on the way out. You pay twice and lose a fraction.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. "PNG recompression is lossless, so nothing changes"
&lt;/h2&gt;

&lt;p&gt;This one mostly held. On 261 PNG files, oxipng saved &lt;strong&gt;12.7%&lt;/strong&gt; at the median, and &lt;strong&gt;253 of 261&lt;/strong&gt; came back byte-identical in RGBA.&lt;/p&gt;

&lt;p&gt;The other 8 were cut-out product images with transparent backgrounds. In all 8 the difference was colour values stored underneath fully transparent pixels. Zero visible pixels changed, and composited over white every one was byte-identical to the original. So the claim is true at the level that matters and false at the level of "the bytes are the same", which is a distinction worth making rather than glossing.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. "Photos leak your location"
&lt;/h2&gt;

&lt;p&gt;I scanned 1,086 JPEGs from my own folders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zero&lt;/strong&gt; had usable GPS coordinates. 32% had some EXIF at all, 20.6% XMP, 20% ICC.&lt;/p&gt;

&lt;p&gt;What the scan did find was metadata that nobody thinks about: the largest single file had &lt;strong&gt;90.7% of its bytes&lt;/strong&gt; in the metadata block, over 2 MB of thumbnail and edit history attached to a small image. The privacy story is real, but it is about size and editing history far more than about coordinates.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data
&lt;/h2&gt;

&lt;p&gt;All five measurements, plus the encoder preset comparison, are downloadable as JSON under CC BY 4.0, one file per study with per-image records where the study produced them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://compressdog.com/measurements/datasets/" rel="noopener noreferrer"&gt;compressdog.com/measurements/datasets&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Five of the six have per-file rows. The metadata scan is aggregate only, and says so on the page. If you rerun any of them and get a different answer, I would like to hear about it: the scripts are named on each article, and the caveats are on the page rather than buried.&lt;/p&gt;

&lt;p&gt;The one thing I would ask is that if you cite a number, link the datasets page rather than the JSON file. That way a reader can find the method and the limits along with the figure.&lt;/p&gt;

</description>
      <category>imageprocessing</category>
      <category>performance</category>
      <category>webdev</category>
      <category>data</category>
    </item>
    <item>
      <title>Three of the Compression Numbers My Own UI Was Advertising Were Wrong</title>
      <dc:creator>CompressDog</dc:creator>
      <pubDate>Mon, 02 Nov 2026 01:20:06 +0000</pubDate>
      <link>https://dev.to/compressdog/three-of-the-compression-numbers-my-own-ui-was-advertising-were-wrong-4neo</link>
      <guid>https://dev.to/compressdog/three-of-the-compression-numbers-my-own-ui-was-advertising-were-wrong-4neo</guid>
      <description>&lt;p&gt;My &lt;a href="https://compressdog.com/" rel="noopener noreferrer"&gt;compressor&lt;/a&gt; has a row of small buttons under it. Each one advertises a saving:&lt;br&gt;
"about 3% smaller in our tests", "+0.6%", "about 2% larger", "5–10% smaller".&lt;/p&gt;

&lt;p&gt;Those numbers came from six images and a PSNR score.&lt;/p&gt;

&lt;p&gt;Six images is a spot check, not a test. And PSNR was the wrong metric — my own&lt;br&gt;
encoder code says so, which is why it had already been replaced with SSIMULACRA2.&lt;br&gt;
So the captions were quoting a number from a method I had stopped trusting, printed&lt;br&gt;
next to a button four times a day.&lt;/p&gt;

&lt;p&gt;I re-ran it on 320 images. Two captions didn't survive, and one of them wasn't an&lt;br&gt;
error of degree — it was comparing the wrong two quantities.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it was measured
&lt;/h2&gt;

&lt;p&gt;320 images, at most six from each folder of a collection, so no single style&lt;br&gt;
dominates. Each was scaled so its longest side is 768 px and saved as a PNG. That&lt;br&gt;
PNG is the reference everything is scored against.&lt;/p&gt;

&lt;p&gt;Then the same reference was encoded once per setting at quality 90, chroma sampling&lt;br&gt;
held at 4:4:4. One variable: which button you press.&lt;/p&gt;

&lt;p&gt;The settings aren't redefined for the test — they're imported from the same module&lt;br&gt;
the app runs. That matters more than it sounds: if I'd copied the parameters into a&lt;br&gt;
test script, I would have measured the script.&lt;/p&gt;

&lt;p&gt;Scoring is SSIMULACRA2 against the reference. Higher is better.&lt;/p&gt;

&lt;h2&gt;
  
  
  What came back
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;balanced&lt;/strong&gt; (the default): 243.1 KB, mean score 86.12&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;size&lt;/strong&gt; (standard tables): 225.4 KB, −7.28% and score 86.74, smaller on 318 of 320&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;quality&lt;/strong&gt; (trellis): 244.2 KB, +0.44% and score 86.14, smaller on none&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;compat&lt;/strong&gt; (baseline): 250.3 KB, +2.94% and score 86.12, smaller on none&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;jpegli&lt;/strong&gt;: 244.0 KB, +0.36% and score 89.60, smaller on 166 of 320&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Caption one said "about 3% smaller".&lt;/strong&gt; It's 7.28% smaller, and the mean score is&lt;br&gt;
slightly higher than the default rather than equal. On 306 of 320 images the score&lt;br&gt;
went up.&lt;/p&gt;

&lt;p&gt;I don't have a satisfying explanation for that. "Quality 90" doesn't mean the same&lt;br&gt;
thing for the two quantisation tables — mozjpeg's tuned table is built for images&lt;br&gt;
being squeezed hard, and at q90 it spends its budget differently. I haven't traced&lt;br&gt;
which coefficients change. That's a guess and I'm labelling it as one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caption two said "5–10% smaller than the default at the same setting".&lt;/strong&gt; At the&lt;br&gt;
same quality &lt;em&gt;number&lt;/em&gt;, jpegli comes out 0.36% &lt;strong&gt;larger&lt;/strong&gt; — and scores 3.48 points&lt;br&gt;
higher, winning on all 320. The 5–10% figure comes from a different comparison:&lt;br&gt;
equal &lt;em&gt;measured&lt;/em&gt; quality, not equal slider position. There's a calibration table for&lt;br&gt;
exactly that, and at matched scores jpegli really is smaller by that much.&lt;/p&gt;

&lt;p&gt;Both statements can be true. But the button sits directly under a quality slider, so&lt;br&gt;
"at the same setting" reads as "at the same slider position". Under that reading the&lt;br&gt;
caption was false.&lt;/p&gt;

&lt;p&gt;There's a general lesson here that cost me less than it could have: &lt;strong&gt;when you write&lt;br&gt;
a comparison, write down the thing you're holding constant.&lt;/strong&gt; Both of these were&lt;br&gt;
"true" measurements of &lt;em&gt;something&lt;/em&gt;. Only one of them answered the question the UI&lt;br&gt;
was asking.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed
&lt;/h2&gt;

&lt;p&gt;Three captions, in both languages. &lt;code&gt;size&lt;/code&gt; now says 7%, &lt;code&gt;compat&lt;/code&gt; says 3%, and jpegli&lt;br&gt;
says what it actually buys: higher measured quality at roughly the same file size,&lt;br&gt;
rather than a size saving at the same quality number.&lt;/p&gt;

&lt;p&gt;The trellis caption held up better (+0.6% predicted, +0.44% measured) but its&lt;br&gt;
"a little more detail" only held on 195 of 320 images. The wording says so now.&lt;/p&gt;

&lt;h2&gt;
  
  
  The number I did not change, and why
&lt;/h2&gt;

&lt;p&gt;At q90 the standard-tables setting is smaller &lt;em&gt;and&lt;/em&gt; scores higher than the tuned&lt;br&gt;
default. That's a strong enough result that it looked like the default should move.&lt;/p&gt;

&lt;p&gt;It moved — but only after a second run. I tested the rest of the quality curve,&lt;br&gt;
because the tuned table's whole justification is that it degrades more gracefully&lt;br&gt;
when you compress hard, and q90 says nothing about that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;q40&lt;/strong&gt;: tuned 73.0 KB / 60.44 · standard 75.1 KB / 62.89 → 2.88% bigger, 2.45 points higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;q50&lt;/strong&gt;: tuned 86.5 KB / 65.71 · standard 87.7 KB / 67.38 → 1.39% bigger, 1.67 higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;q60&lt;/strong&gt;: tuned 101.3 KB / 69.64 · standard 101.2 KB / 70.82 → dead even, 1.18 higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;q70&lt;/strong&gt;: tuned 122.9 KB / 74.23 · standard 121.2 KB / 75.05 → 1.38% smaller, 0.82 higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;q90&lt;/strong&gt;: tuned 243.1 KB / 86.12 · standard 225.4 KB / 86.74 → 7.28% smaller, 0.62 higher&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hypothesis was wrong in a specific way. The tuned table &lt;em&gt;does&lt;/em&gt; produce smaller&lt;br&gt;
files below q60. It just never scores higher at any quality I tested. So "designed&lt;br&gt;
for heavy compression" means "smaller at the same nominal setting", not "better at&lt;br&gt;
the same nominal setting". Those are different claims.&lt;/p&gt;

&lt;p&gt;Above q60 it's bigger &lt;em&gt;and&lt;/em&gt; scores lower, and my slider defaults to 80. So the&lt;br&gt;
default became &lt;code&gt;size&lt;/code&gt;, and &lt;code&gt;balanced&lt;/code&gt; stays available for the case it's actually&lt;br&gt;
good at.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;p&gt;768 px images — most photos people compress are bigger, and encoders don't behave&lt;br&gt;
identically across scales.&lt;/p&gt;

&lt;p&gt;One collection, mostly already-compressed JPEGs, so this is the cost of a second&lt;br&gt;
pass rather than a first one.&lt;/p&gt;

&lt;p&gt;One build of mozjpeg and one of jpegli. Both ship changes.&lt;/p&gt;

&lt;p&gt;Five quality points is a curve sketch, not a curve. The crossover is somewhere&lt;br&gt;
between 50 and 60 by my data; I didn't refine it and I'm not going to quote a precise&lt;br&gt;
number I didn't measure.&lt;/p&gt;

&lt;p&gt;And a score is not your eyes. SSIMULACRA2 tracks human judgement well on average —&lt;br&gt;
but "on average" is carrying weight in that sentence.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you want to run it
&lt;/h2&gt;

&lt;p&gt;The pipeline is short enough to rebuild in an afternoon. Resize each source so its&lt;br&gt;
longest side is 768 px and save a PNG; that PNG is the reference. Encode that same&lt;br&gt;
reference once per setting at quality 90, and score every output against the&lt;br&gt;
reference with SSIMULACRA2. Pillow handles the resize, and &lt;code&gt;ssimulacra2&lt;/code&gt; is a single&lt;br&gt;
binary you call once per file.&lt;/p&gt;

&lt;p&gt;320 images took about eight minutes for the encoder comparison and eleven for the&lt;br&gt;
quality curve. Most of that was the scorer rather than the encoders.&lt;/p&gt;

&lt;p&gt;If you run it on your own library and get a materially different number, I'd like to&lt;br&gt;
hear it. A contradiction with a concrete example is more useful than agreement, and&lt;br&gt;
&lt;a href="https://compressdog.com/about" rel="noopener noreferrer"&gt;the address is on the about page&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hello from a beginner 👋</title>
      <dc:creator>CompressDog</dc:creator>
      <pubDate>Wed, 07 Oct 2026 00:29:12 +0000</pubDate>
      <link>https://dev.to/compressdog/hello-from-a-beginner-9bn</link>
      <guid>https://dev.to/compressdog/hello-from-a-beginner-9bn</guid>
      <description>&lt;p&gt;Hey everyone! I’m pretty new to programming and only started learning it recently. I got into it because I needed a simple way to compress images without uploading my files anywhere. I couldn’t really find a tool that worked the way I wanted, so I tried making one myself. It started as a small thing on my computer, but a few people ended up asking if they could use it too. So I turned it into a little browser tool called CompressDog. Still learning a lot along the way, and English isn’t my first language either 😅 What are you guys working on these days?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devchallenge</category>
      <category>tools</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
