<?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: Андрей Журба</title>
    <description>The latest articles on DEV Community by Андрей Журба (@zhurba_dev).</description>
    <link>https://dev.to/zhurba_dev</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%2F4274627%2F7e599c2c-ce68-4c0e-8070-ae2ac84084cc.png</url>
      <title>DEV Community: Андрей Журба</title>
      <link>https://dev.to/zhurba_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zhurba_dev"/>
    <language>en</language>
    <item>
      <title>Your images don't need a server: what I learned building browser-only image tools</title>
      <dc:creator>Андрей Журба</dc:creator>
      <pubDate>Mon, 30 Nov 2026 15:44:38 +0000</pubDate>
      <link>https://dev.to/zhurba_dev/your-images-dont-need-a-server-what-i-learned-building-browser-only-image-tools-4mca</link>
      <guid>https://dev.to/zhurba_dev/your-images-dont-need-a-server-what-i-learned-building-browser-only-image-tools-4mca</guid>
      <description>&lt;p&gt;Every "free image compressor" website follows the same script: you upload a 12 MB photo to some server, the server compresses it, sends it back, and quietly keeps a copy. I got tired of that pattern and built &lt;a href="https://getresizer.com" rel="noopener noreferrer"&gt;GetResizer&lt;/a&gt; — a suite of image tools (resize, compress-to-exact-size, HEIC/WebP/PDF conversion) that run 100% in the browser. No byte of the user's image ever leaves the machine.&lt;/p&gt;

&lt;p&gt;Here's what I learned building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "Compress to exactly 200 KB" is a binary search problem
&lt;/h2&gt;

&lt;p&gt;Portals (visa forms, government sites, marketplaces) love demanding "photo must be under 200 KB". A quality slider is terrible UX for this. The good approach: binary-search JPEG quality (and downscale if needed) until the output fits the target:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;compressToTarget&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetBytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;blob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blob&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;targetBytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;blob&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;best&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8 iterations, exact result, zero slider anxiety. This became my most-used feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. HEIC is the real boss fight
&lt;/h2&gt;

&lt;p&gt;iPhone photos are HEIC, and browsers (except Safari) can't decode it. The fix is &lt;code&gt;heic2any&lt;/code&gt; — a WASM build of libheif. It works, but:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it's ~1.5 MB of WASM, so lazy-load it only when a &lt;code&gt;.heic&lt;/code&gt; file is detected;&lt;/li&gt;
&lt;li&gt;decoding a 12 MP photo on a mid-range phone takes 2-4 seconds — you need progress UI or users think it's broken;&lt;/li&gt;
&lt;li&gt;EXIF orientation comes through wrong more often than you'd expect. Always respect &lt;code&gt;image-orientation&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Canvas has a silent memory ceiling
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;canvas.toBlob()&lt;/code&gt; on a 100 MP image will crash mobile Safari without warning. Cap working resolution and process in tiles for extreme cases. Rule of thumb: keep canvas area under ~268 MP and pixel memory under ~512 MB.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Privacy is a feature people actually search for
&lt;/h2&gt;

&lt;p&gt;"image resizer that doesn't upload" is a real query with real volume. For IDs, passports and documents people genuinely don't want server copies. The browser-as-backend pitch is not a gimmick — it's the reason users stay.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The boring 80%
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;createImageBitmap&lt;/code&gt; decodes 5-10x faster than &lt;code&gt;new Image()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;OffscreenCanvas&lt;/code&gt; + a Web Worker keeps the UI from freezing&lt;/li&gt;
&lt;li&gt;WebP encoding is universal now; AVIF is still ~10x slower than JPEG to encode client-side&lt;/li&gt;
&lt;li&gt;for batch jobs (100 files) you need a queue with concurrency limits, or Chrome tabs OOM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is live at &lt;a href="https://getresizer.com" rel="noopener noreferrer"&gt;getresizer.com&lt;/a&gt; — free, no signup, files never leave the device. Happy to answer questions about client-side image processing.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>showdev</category>
      <category>sideprojects</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
