<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Joan Bernier Pixels]]></title><description><![CDATA[Joan Bernier Pixels]]></description><link>https://joanbernierpixels.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 21 Nov 2026 15:38:56 GMT</lastBuildDate><atom:link href="https://joanbernierpixels.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[TinyPNG vs Squoosh vs a Browser-Local Tool: How to Run Your Own Test Before You Compress Image Assets]]></title><description><![CDATA[If you need to compress image assets for a docs site or a launch page — a folder of screenshots, a few hero photos, some PNG diagrams — the usual question…]]></description><link>https://joanbernierpixels.hashnode.dev/tinypng-vs-squoosh-vs-a-browser-local-tool-how-to-run-your-own-test-before-you-compress-image-assets</link><guid isPermaLink="true">https://joanbernierpixels.hashnode.dev/tinypng-vs-squoosh-vs-a-browser-local-tool-how-to-run-your-own-test-before-you-compress-image-assets</guid><category><![CDATA[web performance]]></category><category><![CDATA[images]]></category><category><![CDATA[optimization]]></category><category><![CDATA[frontend]]></category><category><![CDATA[privacy]]></category><dc:creator><![CDATA[Joan Bernier]]></dc:creator><pubDate>Sat, 21 Nov 2026 08:32:14 GMT</pubDate><content:encoded><![CDATA[<img src="https://cdn.hashnode.com/uploads/covers/6afed74b6f716ef9fdb399ae/dc195ee8-2bf2-4876-aed4-8877b5ccc1cb.jpg" alt="Compress Image page on pixoffline with a sample photo loaded and WebP output selected, showing the file going from 164.3 KB to 88.4 KB" style="display:block;margin:0 auto" />

<p>If you need to compress image assets for a docs site or a launch page — a folder of screenshots, a few hero photos, some PNG diagrams — the usual question is whether TinyPNG, Squoosh, or a browser-local compressor does the job best for <em>your</em> files. Published benchmarks rarely match your images, so this post is a method: how to run the comparison yourself, with a script, and what to look for in the output.</p>
<p><em>Disclosure: the author is affiliated with Pixoffline, the third tool in this comparison. There are no result numbers in this post on purpose; the point is that you produce your own.</em></p>
<h2>Build a small, representative test set</h2>
<p>Twelve files is enough to see patterns without spending an afternoon:</p>
<ul>
<li>4 photos (JPG) — the kind you actually ship, such as hero images or product shots</li>
<li>4 UI screenshots (PNG) — flat color and small text, the hardest case for lossy compression</li>
<li>4 diagrams or icons (PNG with transparency)</li>
</ul>
<p>Two rules:</p>
<ul>
<li><strong>Use files you're allowed to send to a third-party server.</strong> One of the tools uploads; keep internal screenshots out of the test set.</li>
<li><strong>Keep originals untouched</strong> in <code>./orig</code>, and save each tool's output into its own folder: <code>./tinypng</code>, <code>./squoosh</code>, <code>./local</code>.</li>
</ul>
<h2>Fix the settings before you compare</h2>
<p>The most common mistake in tool comparisons is comparing defaults rather than tools. Each tool ships a different default quality, so whichever one picks the lower setting "wins" on size.</p>
<ul>
<li>Where a tool exposes quality, set it explicitly and write it down.</li>
<li>Use the same output format per set (JPG for photos; PNG or WebP for screenshots and diagrams).</li>
<li>Don't resize in one tool and not the others.</li>
</ul>
<h2>The script</h2>
<p>File size is easy. "Looks the same" is not, so use SSIM against the original as a first filter, then look at the worst-scoring file in each set at 100% zoom.</p>
<pre><code class="language-bash">
# total size per folder, in bytes

for d in orig tinypng squoosh local; do

  echo "$d: $(du -cb $d/* | tail -1 | cut -f1)"

done

# SSIM per file (ImageMagick 7). 1.0 = identical.

for f in orig/*; do

  n=$(basename "$f")

  for d in tinypng squoosh local; do

    o=$(ls $d/${n%.*}* | head -1)

    s=$(magick compare -metric SSIM "$f" "$o" null: 2&gt;&amp;1)

    echo "$n,$d,$s"

  done

done &gt; ssim.csv

# lowest SSIM per tool: the files to open at 100%

sort -t, -k3 -n ssim.csv | head -6
</code></pre>
<p>SSIM isn't perfect for screenshots with tiny text, which is why the last line matters: always eyeball the lowest scores instead of trusting an average.</p>
<h2>What each tool is, before you start</h2>
<p><strong>TinyPNG (</strong><a href="http://tinypng.com"><strong>tinypng.com</strong></a><strong>).</strong> Drag and drop, very few settings. Files are uploaded and processed on their servers, which is fine for public marketing images and not for anything under NDA. Check their current free-tier limits before planning a big batch.</p>
<p><strong>Squoosh (squoosh.app).</strong> Runs in the browser, so files stay local. It exposes every knob — codec, quality, resize, palette reduction — with a side-by-side preview. The web app works on one image at a time.</p>
<p><strong>Pixoffline's Compress Image (browser-local).</strong> Also runs in the browser with nothing uploaded. Per its page: up to 50 files at once (50 MB each); a quality mode (default 78) or a max-file-size mode in KB; JPG through MozJPEG; PNG reduced to an optimized palette of up to 256 colors by default, with a lossless option; WebP and AVIF outputs; camera data and GPS stripped by default, color profiles kept; and if compressing would make a file larger, the original is kept.</p>
<h2>What to look for in the results</h2>
<p><strong>Photos.</strong> Compare size at matched quality, then open the lowest-SSIM photo from each tool. Look at skies and skin for banding or blockiness. If sizes are close, defaults and workflow will matter more than codec choice.</p>
<p><strong>Screenshots.</strong> This is where palette reduction shows its trade-off. A UI screenshot with flat colors can shrink a lot as a 256-color PNG; the risks are banding in gradients and colored fringes around small text. Zoom to 100% on the smallest text in each output. The local tool says it keeps full color detail for screenshots and text automatically — check that claim on your own files.</p>
<p><strong>Diagrams with transparency.</strong> Confirm the alpha channel survived: open each output on a dark background. Converting to JPG flattens transparency, and an already-optimized PNG can come back larger after some passes. Compare output size to input size for every file, not just the total.</p>
<p><strong>Metadata.</strong> Run <code>exiftool</code> on a photo from each folder. Stripped GPS is good for privacy and size; stripped color profiles can shift colors.</p>
<p><strong>Batch ergonomics.</strong> Time the whole set end to end, including downloading. Twelve files one at a time is tolerable; a real folder of a few hundred is a different question. Count the clicks as well as the seconds.</p>
<p><strong>Privacy.</strong> This isn't a score, it's a filter. If any of your real images can't leave the machine, only the two browser-based options are candidates.</p>
<h2>A workflow that holds up</h2>
<ol>
<li>Resize first. A 4000 px screenshot displayed at 1200 px wastes most of its bytes; compression can't fix that.</li>
<li>Run the batch through <a href="https://pixoffline.com/compress-image/">Compress Image</a> or your pick from the comparison at an explicit quality, not a default.</li>
<li>For any upload with a hard limit, use max-file-size mode and type the KB number instead of guessing quality.</li>
<li>Run the SSIM loop above, open the lowest scores at 100%, and only then commit the files.</li>
</ol>
<p>Squoosh remains a good single-file playground when you want every setting exposed. For a folder of assets that shouldn't leave the machine, a <a href="https://pixoffline.com/compress-image/">batch image compressor that runs in the browser</a> fits the same workflow.</p>
<p>Run the script on your own files before trusting anyone else's benchmark table.</p>
]]></content:encoded></item><item><title><![CDATA[How I Prepared Pencil Level Sketches for a Game Jam: A Short Case Study to Invert Image Scans]]></title><description><![CDATA[Nine graph-paper floor plans, one strength slider and a batch export: what worked and what I had to fix by hand.]]></description><link>https://joanbernierpixels.hashnode.dev/invert-image-pencil-level-sketches-game-jam</link><guid isPermaLink="true">https://joanbernierpixels.hashnode.dev/invert-image-pencil-level-sketches-game-jam</guid><category><![CDATA[GameDev]]></category><category><![CDATA[pixelArt]]></category><category><![CDATA[webdev]]></category><category><![CDATA[Tutorial]]></category><category><![CDATA[Design]]></category><dc:creator><![CDATA[Joan Bernier]]></dc:creator><pubDate>Thu, 19 Nov 2026 11:08:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afed74b6f716ef9fdb399ae/dcd37bd3-2f6c-4e9b-ae1d-b5a5d503cc22.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Our last game jam entry was a small dungeon crawler, and the levels started life as pencil sketches on graph paper. This is a short write-up of how I got those sketches into the game as map backgrounds, including the one trick that saved me an evening: I had to invert image scans so the pencil lines turned light on a dark page.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6afed74b6f716ef9fdb399ae/a9cfad3c-c53f-4f05-a7c1-c7a9aab9335f.jpg" alt="Three pencil dungeon sketches on graph paper lying on a wooden desk" style="display:block;margin:0 auto" />

<h2>The problem</h2>
<p>The jam theme was "underground", so the game's UI was dark: near-black panels, pale text. Nine hand-drawn floor plans on white paper looked awful sitting inside that. I wanted the map screen to look like chalk on slate, with pale lines on a dark ground.</p>
<p>I could have redrawn everything as vector lines, but we had 48 hours total and I was the only one drawing. So the plan was to photograph the sheets, flip them, and tune them by eye.</p>
<h2>Step 1: Photograph the pages</h2>
<p>I shot all nine sheets with my phone on a desk by a window. Two things helped:</p>
<ul>
<li>Shoot straight down, with the paper filling most of the frame.</li>
<li>Keep the light even. A shadow across a page turns into a bright band after flipping, and it is hard to remove later.</li>
</ul>
<p>My phone saves HEIC by default. I was worried about converting files, but the tool I used accepts HEIC, JPG, PNG, WebP and TIFF up to 20 MB each, so I skipped the conversion step entirely.</p>
<h2>Step 2: Flip one sheet and look at it</h2>
<p>Before touching all nine, I opened the single-photo page to <a href="https://invertimage.app/">invert image</a> files one at a time and tried one sheet. The inversion is simple math, 255 minus each color channel, so white paper becomes black and grey pencil becomes light grey.</p>
<p>The file never leaves your machine; the page says local files are processed on device, which was nice to know since the levels were unreleased. There is no account and no watermark either.</p>
<p>The first result was a bit harsh. Pure inversion made the paper pitch black and the faint graph-paper grid showed up as a noisy texture. That is where the strength slider came in. Below 100% the inversion is partial, so the page ends up a dark grey instead of black and the grid fades back. At around 85% the lines were still clearly readable and the background sat a little above the UI panels, which gave the map a subtle frame. The before/after handle made it easy to compare without exporting anything.</p>
<h2>Step 3: Do the rest as a batch</h2>
<p>Nine sheets with the same settings is exactly what a batch tool is for. I used the <a href="https://invertimage.app/">batch color inverter</a>, set the strength once, dropped in all nine photos and downloaded the ZIP. The limits at the time of writing are up to 30 images per batch and 20 MB each, plus a limit on decoded dimensions, so full-size phone photos are fine but don't try to push a 300-megapixel scan through it.</p>
<p>Two caveats I ran into:</p>
<ol>
<li>The export keeps the original pixel dimensions after orientation is applied, so my files came out huge. That is fine as a source, but I scaled them down in my engine's import settings.</li>
<li>The files are re-encoded, so file sizes differ from the originals. I exported PNG for line work, since JPEG artifacts around thin lines are visible on a dark ground.</li>
</ol>
<h2>Step 4: Fix what the tool can't</h2>
<p>Be realistic about what a color flip does. It does not straighten a crooked photo, it does not remove a shadow, and it does not clean up smudged pencil. Three of my nine sheets had a visible fold crease that became a bright diagonal line. I painted those out by hand in my image editor, which took about ten minutes each. If I did it again I would flatten the sheets under a book before photographing them.</p>
<h2>What I would do differently</h2>
<ul>
<li>Draw with a darker pencil. Soft 2B lines survive the flip with more contrast than the light HB lines I used for the first few levels.</li>
<li>Skip graph paper with a strong grid, or draw on plain paper. The faint grid was the main source of noise.</li>
<li>Decide on the final resolution before shooting, so you don't carry giant files through the whole project.</li>
</ul>
<h2>Result</h2>
<p>The map screen ended up looking like a chalk plan pinned to a dungeon wall, and it cost about an hour instead of the whole evening I had budgeted for redrawing. It is not a polished art pipeline. It is a quick, honest way to turn paper sketches into game-ready backgrounds when the clock is running.</p>
<p>If you have a stack of sketches, notes or scans that need to flip from dark-on-light to light-on-dark, try one page first, adjust the strength, then batch the rest. That is the whole trick.</p>
]]></content:encoded></item></channel></rss>