<?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: Alex</title>
    <description>The latest articles on DEV Community by Alex (@alex_poiny).</description>
    <link>https://dev.to/alex_poiny</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%2F4046222%2F75388005-7fbe-4a85-9842-7839e5fba764.png</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/alex_poiny</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex_poiny"/>
    <language>en</language>
    <item>
      <title>I got tired of uploading my HEIC photos to random servers, so I built a WASM-powered client-side converter</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Sat, 25 Jul 2026 01:04:25 +0000</pubDate>
      <link>https://dev.to/alex_poiny/i-got-tired-of-uploading-my-heic-photos-to-random-servers-so-i-built-a-wasm-powered-client-side-kib</link>
      <guid>https://dev.to/alex_poiny/i-got-tired-of-uploading-my-heic-photos-to-random-servers-so-i-built-a-wasm-powered-client-side-kib</guid>
      <description>&lt;p&gt;Hi Dev.to! 👋&lt;/p&gt;

&lt;p&gt;Picture this: You are in the middle of a development sprint, a client sends you a batch of assets they took on their iPhone, and you drag them into your project folder.&lt;/p&gt;

&lt;p&gt;Suddenly, your build fails. Your browser won't render them. Figma is throwing errors.&lt;/p&gt;

&lt;p&gt;They are .heic files.&lt;/p&gt;

&lt;p&gt;Apple’s High-Efficiency Image Container (HEIC) is a marvel of compression engineering, saving gigabytes of storage on our phones. But outside the Apple ecosystem? It is an absolute nightmare for web developers and designers.&lt;/p&gt;

&lt;p&gt;The architectural sin of most online converters&lt;br&gt;
If you Google "convert HEIC," you are hit with a wall of ad-heavy, SEO-farmed websites. As a developer, using these tools always frustrated me because the underlying architecture makes no sense:&lt;/p&gt;

&lt;p&gt;The Privacy Risk: You are taking personal photos, ID cards, or sensitive documents and uploading them to an unknown remote server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Bandwidth Tax: Why am I sending a 5MB payload over the network, waiting in a server queue, and downloading it again, just to change a file extension?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Artificial Limits: "You have reached your limit of 3 free conversions."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Processing an image shouldn't require an HTTP request. Modern browsers have plenty of computing power to handle this locally. So, I decided to build a purely "dev-native" solution.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🚀 Enter HEIC Tools: 100% Local, Zero Uploads&lt;/strong&gt;&lt;br&gt;
I built a suite of utilities where the conversion engine runs entirely inside your browser's memory.&lt;/p&gt;

&lt;p&gt;By offloading the heavy lifting to your local CPU, the files never leave your machine. You could literally load the page, disconnect your Wi-Fi, and it would still process your files perfectly.&lt;/p&gt;

&lt;p&gt;Because different workflows require different outputs, I split the engine into three optimized pipelines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For Web &amp;amp; CMS: When you need maximum compatibility and lightweight assets for a website, run them through the &lt;a href="https://heictools.io/" rel="noopener noreferrer"&gt;HEIC to JPG&lt;/a&gt; pipeline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For UI/UX Design: When you are importing assets into Figma or Photoshop and cannot afford compression artifacts (or need transparent backgrounds), use the lossless &lt;a href="https://heictools.io/heic-to-png" rel="noopener noreferrer"&gt;HEIC to PNG&lt;/a&gt; converter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For Document Archiving: If you scanned contracts, whiteboards, or invoices with your iPhone, you don't want scattered image files. You can stitch those frames together into a single, clean document using the &lt;a href="https://heictools.io/heic-to-pdf" rel="noopener noreferrer"&gt;HEIC to PDF&lt;/a&gt; compiler.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🛠 Under the Hood: WebAssembly &amp;amp; Web Workers&lt;/strong&gt;&lt;br&gt;
Building this was a fantastic exercise in browser performance management.&lt;/p&gt;

&lt;p&gt;To decode Apple's proprietary format in the browser, I utilized WebAssembly (WASM) via the open-source &lt;code&gt;libheif-js&lt;/code&gt; module. But if you run a heavy WASM decoding task on the main JavaScript thread, the entire browser UI will freeze.&lt;/p&gt;

&lt;p&gt;To solve this, the binary data is passed to a Web Worker, which churns through the decoding in the background.&lt;/p&gt;

&lt;p&gt;The tricky part? HEIC isn't just an image; it's a container. A single &lt;code&gt;.heic&lt;/code&gt; file can hold multiple frames (like a burst shot, a thumbnail, or a Live Photo). If you blindly export the first frame you find, you might end up with a blurry 256x256 thumbnail.&lt;/p&gt;

&lt;p&gt;Here is the extraction logic I wrote inside the Web Worker to dynamically hunt down the highest-resolution frame before rendering it:&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="c1"&gt;// 'decodedFrames' is the array of images extracted by the WASM decoder&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;primaryImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;decodedFrames&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;let&lt;/span&gt; &lt;span class="nx"&gt;maxResolutionArea&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;primaryImage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_width&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;primaryImage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_height&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Iterate through the HEIC container to isolate the main, high-res photo&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="nx"&gt;i&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="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;decodedFrames&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&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;let&lt;/span&gt; &lt;span class="nx"&gt;currentArea&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;decodedFrames&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get_width&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;decodedFrames&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get_height&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="nx"&gt;currentArea&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;maxResolutionArea&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="nx"&gt;primaryImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;decodedFrames&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; 
        &lt;span class="nx"&gt;maxResolutionArea&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;currentArea&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="c1"&gt;// 'primaryImage' is now locked in. We draw it to an OffscreenCanvas &lt;/span&gt;
&lt;span class="c1"&gt;// and export it locally as a Blob.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Why build Single-Purpose Tools?&lt;/strong&gt;&lt;br&gt;
The web is cluttered with heavy, bloated SaaS apps. I believe there is a massive space for blazing-fast, single-purpose utilities that respect user privacy and do exactly one thing perfectly.&lt;/p&gt;

&lt;p&gt;Next time you AirDrop a batch of photos and get hit with that dreaded .heic extension, give it a spin.&lt;/p&gt;

&lt;p&gt;I’d love to hear your feedback! Let's chat in the comments if you want to dive deeper into how I handled garbage collection for WASM arrays or managed memory spikes when batch-converting large folders. 👇&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
