<?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: El_Necora</title>
    <description>The latest articles on DEV Community by El_Necora (@robertcasschdot).</description>
    <link>https://dev.to/robertcasschdot</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%2F4002115%2Fdf753015-bb13-472f-8c83-9c303cb04976.png</url>
      <title>DEV Community: El_Necora</title>
      <link>https://dev.to/robertcasschdot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/robertcasschdot"/>
    <language>en</language>
    <item>
      <title>I built a private, 100% in-browser JPEG XL converter (no upload, no server)</title>
      <dc:creator>El_Necora</dc:creator>
      <pubDate>Thu, 25 Jun 2026 10:22:14 +0000</pubDate>
      <link>https://dev.to/robertcasschdot/i-built-a-private-100-in-browser-jpeg-xl-converter-no-upload-no-server-493i</link>
      <guid>https://dev.to/robertcasschdot/i-built-a-private-100-in-browser-jpeg-xl-converter-no-upload-no-server-493i</guid>
      <description>&lt;p&gt;If you've ever downloaded a &lt;code&gt;.jxl&lt;/code&gt; file and watched your browser shrug at it, you've met the JPEG XL problem: it's a genuinely great image format that &lt;strong&gt;almost nothing opens yet&lt;/strong&gt;. So I built a small tool that converts images &lt;strong&gt;to and from JPEG XL entirely in the browser&lt;/strong&gt; — no upload, no account, no server touching your files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live:&lt;/strong&gt; &lt;a href="https://jpegxlconvert.com" rel="noopener noreferrer"&gt;https://jpegxlconvert.com&lt;/a&gt; · &lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/robertcassch-dot/jpegxlconvert" rel="noopener noreferrer"&gt;https://github.com/robertcassch-dot/jpegxlconvert&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why bother?
&lt;/h2&gt;

&lt;p&gt;JPEG XL (&lt;code&gt;.jxl&lt;/code&gt;) gives you smaller files at the same quality, lossless JPEG repacking (~20% off your existing JPEGs with zero quality loss), transparency, and a royalty-free spec. The catch in 2026 is &lt;strong&gt;support&lt;/strong&gt;: most browsers and apps still can't display a &lt;code&gt;.jxl&lt;/code&gt;. Chrome removed it in 2022 and is in the process of bringing it back — but until that's everywhere, people keep ending up with &lt;code&gt;.jxl&lt;/code&gt; files they can't view.&lt;/p&gt;

&lt;p&gt;Most "online converters" answer that by &lt;strong&gt;uploading your image to their server&lt;/strong&gt;. For a personal photo, that's a lot of trust for a format conversion. I wanted the opposite: the file never leaves your device.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Everything runs client-side with WebAssembly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JPG / PNG / WebP / GIF → JXL&lt;/strong&gt;: the browser decodes the source natively, then &lt;a href="https://github.com/jamsinclair/jSquash" rel="noopener noreferrer"&gt;&lt;code&gt;@jsquash/jxl&lt;/code&gt;&lt;/a&gt; (libjxl compiled to WASM) encodes the JXL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.jxl&lt;/code&gt; → PNG / JPG&lt;/strong&gt;: decoded with &lt;code&gt;@jsquash/jxl&lt;/code&gt;, re-encoded natively via a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HEIC&lt;/strong&gt; (iPhone photos) → JPG/PNG/JXL: decoded in-browser too, so you can finally open HEIC outside Apple's world.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;encode&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@jsquash/jxl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bitmap&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;createImageBitmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;          &lt;span class="c1"&gt;// native decode&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OffscreenCanvas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getImageData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;jxl&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="nx"&gt;imageData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;quality&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;  &lt;span class="c1"&gt;// WASM encode, on-device&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No &lt;code&gt;fetch()&lt;/code&gt; to a backend anywhere in that path — you can verify it in the Network tab, which is kind of the whole point.&lt;/p&gt;

&lt;h2&gt;
  
  
  A few things I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Self-host the WASM codec.&lt;/strong&gt; Pulling it from a CDN at runtime works in dev, but for speed, reliability and a cleaner privacy story you really want the &lt;code&gt;.wasm&lt;/code&gt; served from your own origin.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Orientation metadata bites you on HEIC.&lt;/strong&gt; iPhone photos lean on EXIF orientation; if you ignore it, half your conversions come out sideways.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A "viewer" is half the product.&lt;/strong&gt; Plenty of people don't want to convert — they just want to &lt;em&gt;see&lt;/em&gt; the &lt;code&gt;.jxl&lt;/code&gt;. Decoding it to a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; and offering a one-click "save as JPG/PNG" turned out to be the most-used path.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  It's open source
&lt;/h2&gt;

&lt;p&gt;The whole static site is on GitHub: &lt;a href="https://github.com/robertcassch-dot/jpegxlconvert" rel="noopener noreferrer"&gt;https://github.com/robertcassch-dot/jpegxlconvert&lt;/a&gt;. It's multilingual (EN/ES/DE/FR/RU), deploys to any static host (I use Cloudflare Pages), and has zero backend.&lt;/p&gt;

&lt;p&gt;If you've got &lt;code&gt;.jxl&lt;/code&gt; files gathering dust, try it: &lt;a href="https://jpegxlconvert.com" rel="noopener noreferrer"&gt;https://jpegxlconvert.com&lt;/a&gt;. Feedback and issues welcome.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webassembly</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
