<?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: Sia </title>
    <description>The latest articles on DEV Community by Sia  (@io64bit).</description>
    <link>https://dev.to/io64bit</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%2F4140043%2F9c546c89-dc5d-4603-a04b-5d1f16f35cb0.jpg</url>
      <title>DEV Community: Sia </title>
      <link>https://dev.to/io64bit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/io64bit"/>
    <language>en</language>
    <item>
      <title>Reading and writing DOCX, PPTX and XLSX in the browser with Rust and WASM</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:41:44 +0000</pubDate>
      <link>https://dev.to/io64bit/reading-and-writing-docx-pptx-and-xlsx-in-the-browser-with-rust-and-wasm-36bk</link>
      <guid>https://dev.to/io64bit/reading-and-writing-docx-pptx-and-xlsx-in-the-browser-with-rust-and-wasm-36bk</guid>
      <description>&lt;p&gt;I built Scissor Office, an office suite for documents, slides and spreadsheets that runs in a browser tab: &lt;a href="https://office.scissor.studio/" rel="noopener noreferrer"&gt;https://office.scissor.studio/&lt;/a&gt;&lt;br&gt;
It opens and saves DOCX, ODT, PPTX, ODP, XLSX and ODS without sending the file to a server. This post is about how that works and where it stops.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzk7vplakyfudy0uasqe4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzk7vplakyfudy0uasqe4.jpg" alt="The Scissor Office document editor" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Three Rust engines, compiled to WebAssembly
&lt;/h2&gt;

&lt;p&gt;Each kind of file has its own engine, written in Rust and compiled with wasm-bindgen. These are the sizes the live site serves today:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;Raw&lt;/th&gt;
&lt;th&gt;Brotli&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Documents&lt;/td&gt;
&lt;td&gt;2.7 MB&lt;/td&gt;
&lt;td&gt;1.05 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Presentations&lt;/td&gt;
&lt;td&gt;1.96 MB&lt;/td&gt;
&lt;td&gt;0.74 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spreadsheets&lt;/td&gt;
&lt;td&gt;3.08 MB&lt;/td&gt;
&lt;td&gt;1.06 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Charts&lt;/td&gt;
&lt;td&gt;0.31 MB&lt;/td&gt;
&lt;td&gt;0.13 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A service worker caches them, so the app works offline after the first visit. The spreadsheet engine runs in a worker, so a big recalculation doesn't block typing.&lt;/p&gt;
&lt;h2&gt;
  
  
  A DOCX is a zip of XML
&lt;/h2&gt;

&lt;p&gt;DOCX, PPTX, XLSX and the OpenDocument formats are all zip files full of XML parts. I wrote a small zip reader and writer on top of two crates: miniz_oxide for deflate and crc32fast for checksums. It supports just what office files need. ODF requires its &lt;code&gt;mimetype&lt;/code&gt; entry to be first and stored uncompressed, so the writer stores it first. There is no zip64 and no encryption.&lt;/p&gt;

&lt;p&gt;The XML is read with quick-xml. The readers and writers follow the published standards, Office Open XML (ISO/IEC 29500) and OpenDocument (ISO/IEC 26300).&lt;/p&gt;

&lt;p&gt;The old binary formats are different. A &lt;code&gt;.doc&lt;/code&gt; file is a compound file, so the engine reads that container first and then Word's FIB, piece table and formatting pages, following Microsoft's published MS-DOC specification. For &lt;code&gt;.doc&lt;/code&gt; it reads only the main text with its formatting, pictures and links. Headers, footnotes and comments are not read from &lt;code&gt;.doc&lt;/code&gt; files yet.&lt;/p&gt;
&lt;h2&gt;
  
  
  The same engine behind every converter
&lt;/h2&gt;

&lt;p&gt;The site also has 14 small converters (DOCX to ODT, XLSX to CSV, PPT to PPTX and so on) and 5 tools, such as accept all tracked changes or extract images. They don't have their own conversion code. A converter page starts a worker that loads the same engine the app uses and calls its import and export functions:&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="nf"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;m&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;docEngine&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;importDoc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&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;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exportDoc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;losses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;docLosses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&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="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;&lt;code&gt;importDoc&lt;/code&gt; turns any supported file into one document model as JSON, and &lt;code&gt;exportDoc&lt;/code&gt; writes that model in the target format. &lt;code&gt;losses&lt;/code&gt; is the list of things the target format can't hold. The page shows that list instead of dropping them without a word.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping what the editor can't edit yet
&lt;/h2&gt;

&lt;p&gt;The slide and spreadsheet editors don't edit everything a real file can hold. In PPTX, tables, charts, SmartArt and animations are kept when you save back to PPTX, but you can't edit them yet. In XLSX, drawings, comments, merged cells, conditional formats, data validation and pivot tables work the same way.&lt;/p&gt;

&lt;p&gt;The presentations engine does this with a keep layer: parts the editor doesn't understand are carried through and written back next to the parts you changed.&lt;/p&gt;

&lt;p&gt;Spreadsheet formulas are recalculated in the tab: over 300 functions, using calculation code vendored from IronCalc 0.9.1 (MIT OR Apache-2.0). To check it, the sheet engine runs IronCalc's 222 test workbooks against Excel's values.&lt;/p&gt;

&lt;h2&gt;
  
  
  How files stay on the device
&lt;/h2&gt;

&lt;p&gt;Drafts are saved in the browser's IndexedDB for this site, on this device. They are not synced anywhere. In Chrome and Edge, Save writes back into the same file on disk. Other browsers download a copy.&lt;/p&gt;

&lt;p&gt;The Content Security Policy starts with &lt;code&gt;default-src 'self'&lt;/code&gt;, and &lt;code&gt;connect-src&lt;/code&gt; allows only this site and Google's sign-in and Drive APIs, for the optional Drive buttons. So even a bug can't upload a document anywhere else. You can check this in the Network tab: nothing is sent when you type, open or save.&lt;/p&gt;

&lt;p&gt;PDF files are read with PDF.js 6.4.299 (Apache 2.0) in the tab, and the document engine rebuilds the text, headings, lists and pictures into an editable document. The other libraries are MIT or similarly permissive: quick-xml, miniz_oxide, pulldown-cmark for Markdown, rustybuzz for text shaping. The full list with versions is at /licenses/ on the site.&lt;/p&gt;

&lt;p&gt;One bug from this week: PDF.js 6 reads text with &lt;code&gt;for await&lt;/code&gt; over a &lt;code&gt;ReadableStream&lt;/code&gt;. Safari before version 26 doesn't support that, so opening a PDF failed on iPhones. I now add the async iterator where it's missing, both on the page and in the PDF.js worker, before PDF.js loads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Formatting fidelity is not Word's. Text, headings, lists, tables, pictures, footnotes, headers and footers, comments and tracked changes are kept in DOCX and ODT. Charts, text boxes and drawn shapes inside documents are not read yet.&lt;/li&gt;
&lt;li&gt;PDF output goes through the browser's print dialog. There is no PDF writer of my own yet.&lt;/li&gt;
&lt;li&gt;Password-protected files can't be opened yet.&lt;/li&gt;
&lt;li&gt;Macros are not kept. An &lt;code&gt;.xlsm&lt;/code&gt; file is saved as a copy without them.&lt;/li&gt;
&lt;li&gt;PDF import works best on PDFs that contain real text. Scanned pages are just pictures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it: &lt;a href="https://office.scissor.studio/" rel="noopener noreferrer"&gt;https://office.scissor.studio/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's free and needs no account. Here is what would help me most: open a real DOCX, PPTX or XLSX from your work, and tell me the first thing that comes out wrong.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webassembly</category>
      <category>webdev</category>
      <category>privacy</category>
    </item>
    <item>
      <title>A LaTeX editor in the browser: Rust converts to Typst, all in WebAssembly</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:41:37 +0000</pubDate>
      <link>https://dev.to/io64bit/a-latex-editor-in-the-browser-rust-converts-to-typst-all-in-webassembly-2hml</link>
      <guid>https://dev.to/io64bit/a-latex-editor-in-the-browser-rust-converts-to-typst-all-in-webassembly-2hml</guid>
      <description>&lt;p&gt;Scissor LaTeX is an editor that typesets LaTeX documents in the browser, with no server and no TeX installation: &lt;a href="https://latex.scissor.studio/app/" rel="noopener noreferrer"&gt;https://latex.scissor.studio/app/&lt;/a&gt;&lt;br&gt;
You write LaTeX on the left, and the pages appear on the right as you type.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpdj383rsvrxkttd9tbr4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpdj383rsvrxkttd9tbr4.jpg" alt="The Scissor LaTeX editor with LaTeX source on the left and the typeset page on the right" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It also has small tools for single jobs: an equation editor, LaTeX to PNG and SVG, a BibTeX formatter, LaTeX to HTML and Markdown. This post is about the editor and how it works.&lt;/p&gt;
&lt;h2&gt;
  
  
  LaTeX is converted, not compiled
&lt;/h2&gt;

&lt;p&gt;A browser can't run a full TeX distribution in any reasonable size. So Scissor LaTeX doesn't run TeX at all. A converter written in Rust reads the LaTeX and writes Typst markup, and Typst 0.15 typesets it. Math is handed to mitex, which turns LaTeX math into Typst math.&lt;/p&gt;

&lt;p&gt;Here is a real input and what the converter makes of it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;\section{Results}
We have $E = mc^2$ and
\begin{equation}
  \int_0^1 x^2\,dx = \tfrac{1}{3}.
\end{equation}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// L4
= Results

// L5
We have #__math(block: false, numbered: false, label: "", "E = mc^2") and

// L6
#__math(block: true, numbered: true, label: "", "\\int_0^1 x^2\\,dx = \\tfrac{1}{3}.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;// L4&lt;/code&gt; comments are source lines. When Typst reports an error, the editor maps it back to the line you wrote. The &lt;code&gt;#__math&lt;/code&gt; and &lt;code&gt;#__setup&lt;/code&gt; calls go to a small Typst library that does the class layout, numbering and labels.&lt;/p&gt;

&lt;p&gt;Both engines are Rust compiled to WebAssembly. Typesetting runs in a Web Worker, so typing never waits for it. The preview is SVG pages, and Export → PDF uses Typst's PDF writer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Packages are implemented one by one
&lt;/h2&gt;

&lt;p&gt;Since no package code runs, every package is something the converter knows. Right now it recognises 728 package names and 45 document classes. Recognised doesn't mean complete. Each package has a docs page with a table of what works, what works partly and what doesn't.&lt;/p&gt;

&lt;p&gt;There are three cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implemented: amsmath, graphicx, booktabs, pgfplots, a subset of TikZ, biblatex citations and many more.&lt;/li&gt;
&lt;li&gt;Known, without effect: fancyhdr, titlesec, microtype. They're accepted, but running headers and heading styles don't change.&lt;/li&gt;
&lt;li&gt;Unknown: a publisher's &lt;code&gt;.sty&lt;/code&gt;, a typo. The Problems tab says the package isn't supported yet, and unknown commands are listed there too. Their text usually stays, without the formatting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a &lt;code&gt;.sty&lt;/code&gt; or &lt;code&gt;.cls&lt;/code&gt; file is in the project, the converter reads part of it: &lt;code&gt;\newcommand&lt;/code&gt; definitions, the packages it loads, colours and margins. Anything else in it is ignored.&lt;/p&gt;

&lt;h2&gt;
  
  
  Missing packages drive the work
&lt;/h2&gt;

&lt;p&gt;When a document loads an unknown package, the editor sends one report with the package's name, once per browser. The document and the other files are never sent. There's also a Request support button on the note.&lt;/p&gt;

&lt;p&gt;The list of names is my to-do list. This month it brought the &lt;code&gt;resume&lt;/code&gt; CV class, &lt;code&gt;tkz-tab&lt;/code&gt; for the sign and variation tables that French maths teaching uses, &lt;code&gt;fvextra&lt;/code&gt; and &lt;code&gt;calligra&lt;/code&gt;. tkz-tab was the biggest: its tables are now drawn in Typst, from the same sizes that tkz-tab.sty uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sizes and licences
&lt;/h2&gt;

&lt;p&gt;The core engine is 6.6 MB of WebAssembly, or 1.7 MB compressed. It loads on every page. The typesetter is 25.6 MB, or 9.8 MB compressed, and loads only when something needs typesetting. A service worker caches both, so the editor also works offline after the first visit.&lt;/p&gt;

&lt;p&gt;The fonts are Latin Modern and New Computer Modern for text and math, under the GUST Font License. The &lt;code&gt;calligra&lt;/code&gt; script is TeX Gyre Chorus, also under GUST, and it's downloaded only the first time a document uses it. Typst, mitex and the other Rust crates are listed with their licences at &lt;a href="https://latex.scissor.studio/licenses/" rel="noopener noreferrer"&gt;https://latex.scissor.studio/licenses/&lt;/a&gt;. Every dependency has to be free for commercial use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your documents stay on your device
&lt;/h2&gt;

&lt;p&gt;Projects are saved in the browser's IndexedDB. There is no upload endpoint, and the Content Security Policy allows only the site itself and, if you use it, Google Drive. Drive uses the &lt;code&gt;drive.file&lt;/code&gt; scope, so the editor sees only the files you open or create with it.&lt;/p&gt;

&lt;p&gt;In Chrome and Edge you can also open a folder on your disk as a live project. Saving writes straight to the files, and changes made in another editor show up in the preview.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;There is no TeX engine, so the output is close to LaTeX's but not identical. Line breaks and page breaks can differ.&lt;/li&gt;
&lt;li&gt;TeX programming beyond simple macros doesn't run: &lt;code&gt;\def&lt;/code&gt; tricks, expl3 code, anything that inspects boxes.&lt;/li&gt;
&lt;li&gt;TikZ is a subset. The &lt;code&gt;picture&lt;/code&gt; environment isn't drawn.&lt;/li&gt;
&lt;li&gt;Packages that only change layout details, like fancyhdr and titlesec, have no effect yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it: &lt;a href="https://latex.scissor.studio/app/" rel="noopener noreferrer"&gt;https://latex.scissor.studio/app/&lt;/a&gt;&lt;br&gt;
It's free and needs no account.&lt;/p&gt;

&lt;p&gt;If you open one of your own documents, which package or command breaks it first? That answer decides what I build next.&lt;/p&gt;

</description>
      <category>latex</category>
      <category>rust</category>
      <category>webassembly</category>
      <category>typst</category>
    </item>
    <item>
      <title>Zip, 7z and RAR in the browser with libarchive compiled to WebAssembly</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:41:29 +0000</pubDate>
      <link>https://dev.to/io64bit/zip-7z-and-rar-in-the-browser-with-libarchive-compiled-to-webassembly-4n2l</link>
      <guid>https://dev.to/io64bit/zip-7z-and-rar-in-the-browser-with-libarchive-compiled-to-webassembly-4n2l</guid>
      <description>&lt;p&gt;I made Scissor Zip, a set of archive tools that run in the browser tab: &lt;a href="https://zip.scissor.studio" rel="noopener noreferrer"&gt;https://zip.scissor.studio&lt;/a&gt;. It zips files, adds AES-256 passwords, opens RAR, 7z and tar.gz, and converts between formats, with libarchive compiled to WebAssembly doing the work on your device.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7ni6rt8n7m8maksp53ul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7ni6rt8n7m8maksp53ul.png" alt="The Scissor Zip archive explorer" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The engine
&lt;/h2&gt;

&lt;p&gt;The engine is libarchive 3.8.10, the library behind bsdtar, built with Emscripten together with the compression libraries it needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;zlib 1.3.2 (zlib licence)&lt;/li&gt;
&lt;li&gt;bzip2 1.0.8 (BSD-style)&lt;/li&gt;
&lt;li&gt;XZ Utils 5.8.4, liblzma only (0BSD)&lt;/li&gt;
&lt;li&gt;Zstandard 1.5.7 (BSD-3-Clause)&lt;/li&gt;
&lt;li&gt;LZ4 1.10.0 (BSD-2-Clause)&lt;/li&gt;
&lt;li&gt;Mbed TLS 3.6.5 (Apache-2.0), for the AES-256 encryption of password-protected zips&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A small C file in front of libarchive exposes about twenty functions: open a buffer, step through entries, read one, write a new archive. The result is &lt;code&gt;archive.wasm&lt;/code&gt; at 1.16 MB, about 324 KB with Brotli, plus a 67 KB JavaScript loader. It runs in a module worker, so a 500 MB archive does not freeze the page.&lt;/p&gt;

&lt;p&gt;All of that is permissive licensing, and the licences page lists each component with its full text in a notices file next to the engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  RAR, and what that means for licences
&lt;/h2&gt;

&lt;p&gt;RAR is the part people ask about. libarchive reads RAR and RAR5 with its own code: &lt;code&gt;archive_read_support_format_rar.c&lt;/code&gt; (Andres Mejia) and &lt;code&gt;archive_read_support_format_rar5.c&lt;/code&gt; (Grzegorz Antoniak), both under the BSD 2-Clause licence. No RARLAB UnRAR source is involved, so there is no UnRAR licence to carry.&lt;/p&gt;

&lt;p&gt;That also sets the limits. libarchive can read RAR but not write it, and RAR is a closed format that only WinRAR may create. So Scissor Zip extracts RAR and converts it to zip, 7z or tar, but never makes a .rar. Encrypted RAR and 7z archives do not open yet; the page says so instead of failing quietly.&lt;/p&gt;

&lt;p&gt;Multi-part RAR archives (&lt;code&gt;name.part1.rar&lt;/code&gt;, &lt;code&gt;name.part2.rar&lt;/code&gt;, ...) work when you choose all the parts together. Each part has its own headers, so they cannot simply be joined. The C side gives libarchive one buffer per volume with &lt;code&gt;archive_read_append_callback_data&lt;/code&gt;, plus read, seek and switch callbacks, and libarchive moves from part to part itself. Split 7z and zip archives (&lt;code&gt;.001&lt;/code&gt;, &lt;code&gt;.002&lt;/code&gt;, ...) are just bytes cut into pieces, so those parts are joined into one &lt;code&gt;File&lt;/code&gt; in JavaScript before the engine sees them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Telling a cut-short file from a broken engine
&lt;/h2&gt;

&lt;p&gt;Big archives on phones are often incomplete: an interrupted download, or only the first part of a split set. libarchive reports that as "Seek error" or "Malformed 7-Zip archive", which used to reach the visitor as "the engine stopped". A 7z file says in its first 32 bytes how long it should be, so the worker checks that before reading the rest:&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;head&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;DataView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&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;32&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="n"&gt;buffer&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;want&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBigUint64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBigUint64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;want&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`PARTIAL: ${file.size}/${want}`&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;The page then says the archive is incomplete, with both sizes, instead of blaming itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the files stay on the device
&lt;/h2&gt;

&lt;p&gt;The browser reads the chosen file with &lt;code&gt;file.arrayBuffer()&lt;/code&gt;, copies it into the WebAssembly heap, and the result goes back as a Blob download. Our servers have no endpoint for your archives. The Content Security Policy only lets the page connect to its own origin, plus Google's sign-in and Drive services for the optional Google Drive open and save. The Drive scope is &lt;code&gt;drive.file&lt;/code&gt;, so the site sees only files you open or save with it, and the Network tab in developer tools shows the rest.&lt;/p&gt;

&lt;p&gt;Error reports carry a code such as ENGINE or MEMORY. When the code alone does not explain the error, the wording goes along too, but anything that looks like a file name or path is removed first.&lt;/p&gt;

&lt;p&gt;A service worker keeps the pages and the engine, so a tool you have opened once works without a connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  The limit: memory
&lt;/h2&gt;

&lt;p&gt;Everything happens in the tab's memory. The archive is read into the WebAssembly heap, which can grow to 4 GB, and creating or converting holds the input and the new archive at the same time. Every out-of-memory report so far came from archives over 1 GB on desktop browsers, so the page now warns from 1 GB and suggests splitting. Streaming files through the engine in chunks would raise that ceiling, and it is the next big change I would like to make.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Try it: &lt;a href="https://zip.scissor.studio" rel="noopener noreferrer"&gt;https://zip.scissor.studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is free, with no account and no ads, in 30 languages. There is also an archive explorer at /app/ that opens several archives side by side, previews images and text, and lets you add, rename or delete files before saving as zip, 7z or tar.&lt;/p&gt;

&lt;p&gt;If you have an archive it fails to open, I would like to know the format and the tool that made it.&lt;/p&gt;

</description>
      <category>webassembly</category>
      <category>javascript</category>
      <category>c</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Running AI writing models and a voice in the browser with WebGPU and WebLLM</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:41:14 +0000</pubDate>
      <link>https://dev.to/io64bit/running-ai-writing-models-and-a-voice-in-the-browser-with-webgpu-and-webllm-4opg</link>
      <guid>https://dev.to/io64bit/running-ai-writing-models-and-a-voice-in-the-browser-with-webgpu-and-webllm-4opg</guid>
      <description>&lt;p&gt;I made &lt;a href="https://text.scissor.studio" rel="noopener noreferrer"&gt;Scissor Text&lt;/a&gt;, 26 free text tools that run in the browser. Fifteen of them use an AI model, and the model runs on your own graphics chip, so the text you type never leaves the tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F10589cwi851gtmi8qy7p.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F10589cwi851gtmi8qy7p.webp" alt="The Scissor Text editor with the AI assistant rewriting a paragraph" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is no server that does the work. The site is static files. The pages are sent with &lt;code&gt;connect-src 'self'&lt;/code&gt; in their Content Security Policy, so the page cannot send your text to another site even by mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is in it
&lt;/h2&gt;

&lt;p&gt;The AI tools are a writer, a grammar checker, a translator, a paraphraser, a summarizer, a humanizer, a tone changer, an email reply writer, a quiz generator and a few smaller ones. The other tools need no model: a word counter, text compare, case converter, find and replace, a JSON formatter and similar. There is also an app with documents kept in the browser's IndexedDB. The site comes in 30 languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three models, one engine
&lt;/h2&gt;

&lt;p&gt;The models run with &lt;a href="https://github.com/mlc-ai/web-llm" rel="noopener noreferrer"&gt;WebLLM&lt;/a&gt; 0.2.87 (Apache-2.0), in a Web Worker on WebGPU. There are three:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Llama 3.2 1B, about 0.7 GB, the fastest (Llama 3.2 Community License)&lt;/li&gt;
&lt;li&gt;Qwen 3.5 2B, about 1.1 GB, the default (Apache-2.0)&lt;/li&gt;
&lt;li&gt;Qwen 3 4B, about 2.3 GB, the best quality (Apache-2.0)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They are 4-bit builds. Chips without 16-bit floats in shaders (&lt;code&gt;shader-f16&lt;/code&gt;) get a 32-bit build of the same model instead.&lt;/p&gt;

&lt;p&gt;The model files and the compiled WebGPU libraries are served from the site itself, not from a model hub. The download is the slow part, so it happens once. The models are kept in one shared store for every Scissor tool, so a model downloaded on one site is already there on the next. If the connection drops, the download carries on from the files it already has.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small graphics chips
&lt;/h2&gt;

&lt;p&gt;Most crash reports came from Windows computers, and they had one number in common: the largest buffer the chip allows, &lt;code&gt;maxBufferSize&lt;/code&gt;, was 2 GB or less. So that is the test:&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;weak&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!!&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;limits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;maxBufferSize&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1048576&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tooBig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;weak&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;lowRam&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="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;1.6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// GB of graphics memory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On those chips the larger models are marked "may crash on this device", and the smallest one is the default. Even then, some of these chips stop responding partway through a long text. My best guess is the Windows GPU timeout, which resets a chip whose single task runs for more than about two seconds. So on weak chips the text goes to the model in parts of 1,500 characters, and in parts of 700 once the device has lost the chip.&lt;/p&gt;

&lt;p&gt;Reloading the page did not help there: the same visitors lost the chip again. Now, if the smallest model fails on such a chip, the page says plainly that this computer cannot run the AI tools, keeps the text, and points to the tools that need no model.&lt;/p&gt;

&lt;h2&gt;
  
  
  A voice without a server
&lt;/h2&gt;

&lt;p&gt;Text to speech has two engines. The browser's own voices start at once and cost nothing. The natural voice is &lt;a href="https://huggingface.co/hexgrad/Kokoro-82M" rel="noopener noreferrer"&gt;Kokoro&lt;/a&gt; 82M (Apache-2.0), run with kokoro-js and ONNX Runtime Web. It runs in WebAssembly, not on the GPU, so it works on more devices. The quantized model is 92 MB, with 28 English voices. The pages are cross-origin isolated (COOP and COEP headers), which lets the worker use several threads.&lt;/p&gt;

&lt;p&gt;The voice runtime includes eSpeak NG for phonemes, which is GPL-3.0. So that bundle runs in its own worker, and it ships with the licence and where to get the source of every part. The voice recorder uses Whisper base (MIT), 76 MB, for transcription, also on the device.&lt;/p&gt;

&lt;h2&gt;
  
  
  The limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The AI tools need WebGPU: a current Chrome or Edge, Safari 26 or later, or Chrome on Android. Elsewhere only the tools without a model work.&lt;/li&gt;
&lt;li&gt;The first use of a model is a download of 0.7 to 2.3 GB. Phones start on the smallest model and get a note to use Wi-Fi.&lt;/li&gt;
&lt;li&gt;These are small models. They are good at rewriting a paragraph and weaker at long or exact work. The smallest one sometimes adds a comment about what it changed.&lt;/li&gt;
&lt;li&gt;The natural voice reads English only. Other languages use the browser's voices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Try it: &lt;a href="https://text.scissor.studio" rel="noopener noreferrer"&gt;https://text.scissor.studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is free, with no account. If your computer has integrated graphics, I would like to know which model worked for you and how long one paragraph took.&lt;/p&gt;

</description>
      <category>webgpu</category>
      <category>javascript</category>
      <category>ai</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Audio tools that never upload: Whisper, LAME and FLAC in the browser</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:41:06 +0000</pubDate>
      <link>https://dev.to/io64bit/audio-tools-that-never-upload-whisper-lame-and-flac-in-the-browser-2gc3</link>
      <guid>https://dev.to/io64bit/audio-tools-that-never-upload-whisper-lame-and-flac-in-the-browser-2gc3</guid>
      <description>&lt;p&gt;I built Scissor Audio, a set of free audio tools that run entirely in the browser: &lt;a href="https://audio.scissor.studio/" rel="noopener noreferrer"&gt;https://audio.scissor.studio/&lt;/a&gt;&lt;br&gt;
You can trim, join, mix, convert, compress, transcribe and tag audio, and the file never leaves your device.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzkjecm5xzidjei2uheyl.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzkjecm5xzidjei2uheyl.webp" alt="The Scissor Audio editor" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are twelve tools and an audio editor, in 30 languages. Here is how the parts fit together, and where they stop.&lt;/p&gt;
&lt;h2&gt;
  
  
  A static site and plain modules
&lt;/h2&gt;

&lt;p&gt;There is no framework and no backend for the audio. One Node script builds every page from a list of tools and a JSON file per language: the HTML, the head tags, the structured data and the service worker. Each tool is an ES module that the page loads when you open it. The site is served as static files from Cloudflare.&lt;/p&gt;

&lt;p&gt;The server sends files and receives anonymous page counts and error reports. Opening, editing and saving all happen in the tab.&lt;/p&gt;
&lt;h2&gt;
  
  
  Decoding is the browser's job
&lt;/h2&gt;

&lt;p&gt;I do not ship my own decoders. The browser already has them, and some formats are covered by patents I do not want to deal with. Every file goes through the Web Audio API and comes out as 44.1 kHz float samples:&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;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&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;ctx&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;OfflineAudioContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;44100&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;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decodeAudioData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&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="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sampleRate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numberOfChannels&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="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getChannelData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&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="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;Decoding everything to the same rate means the joiner and the mixer can line tracks up sample for sample without resampling them again. The cost is memory: an hour of stereo audio is about 1.3 GB once decoded, so very long files can be too much for a phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Encoders: some borrowed, one written by hand
&lt;/h2&gt;

&lt;p&gt;For MP3 the site uses LAME, and for Ogg it uses libvorbis, both compiled to WebAssembly by the wasm-media-encoders project. LAME is LGPL 2.1, so mp3.wasm (133 KB) stays a separate file that anyone can replace with their own build, and the licence page says where it came from. libvorbis and libogg are BSD 3-Clause; ogg.wasm is 450 KB. Both load only when you save in that format.&lt;/p&gt;

&lt;p&gt;M4A uses the browser's own AAC encoder through WebCodecs, with a small MP4 writer around it. WAV is a header and the samples.&lt;/p&gt;

&lt;p&gt;FLAC I wrote myself, because a lossless encoder is small when you keep it simple: 16-bit samples, fixed predictors and Rice coding, with the CRC-8 and CRC-16 each frame needs. It does not reach the compression of the reference encoder, but it is lossless and it is about 100 lines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Speech models on the device
&lt;/h2&gt;

&lt;p&gt;Audio to text runs OpenAI's Whisper base model (MIT) through transformers.js (Apache-2.0) and ONNX Runtime Web (MIT), quantized to 8 bits, in a web worker on WebAssembly, with threads where the browser allows them. The download is about 80 MB: a 23 MB encoder, a 54 MB decoder and a 2.5 MB tokenizer, all served from the same site.&lt;/p&gt;

&lt;p&gt;Text to speech uses Kokoro 82M (Apache-2.0), about 92 MB. The bundle that turns text into phonemes contains eSpeak NG, which is GPL 3.0, so that one file is distributed under the GPL with its sources named.&lt;/p&gt;

&lt;p&gt;Each model downloads once and stays in the browser's storage, so it then works offline. In Chrome, Edge and Firefox the Scissor tools share one copy, so the second tool that needs Whisper does not download it again.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one request that leaves the page
&lt;/h2&gt;

&lt;p&gt;The tag editor reads and writes ID3, MP4 and FLAC tags itself, and saves the same audio bytes with new tags. It can also look tags up in MusicBrainz. Apart from Google Drive, if you choose to open or save there, that is the only time the page talks to another server, and only when you press Search. What it sends is the words in the two search boxes. The cover comes from the Cover Art Archive.&lt;/p&gt;

&lt;p&gt;The Content-Security-Policy lists exactly those hosts in connect-src, so nothing else can be fetched even by mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Whisper base is small. It is fine for clear speech and weaker on noise, accents and names than the larger models. On an older phone a long recording takes a while, since it runs on the CPU.&lt;/li&gt;
&lt;li&gt;The first transcription needs that 80 MB download.&lt;/li&gt;
&lt;li&gt;Safari and browsers on iPhone keep a separate copy of the models for each site.&lt;/li&gt;
&lt;li&gt;Which formats open depends on the browser, because decoding is the browser's.&lt;/li&gt;
&lt;li&gt;M4A output needs the browser's AAC encoder; where it is missing, M4A is not offered.&lt;/li&gt;
&lt;li&gt;The tag editor does not handle WAV or OGG tags yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it: &lt;a href="https://audio.scissor.studio/" rel="noopener noreferrer"&gt;https://audio.scissor.studio/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is free, with no account and no sign-up. One question I would like answered: if you try audio to text on a phone, how long does one minute of speech take on your device, and which phone is it?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webassembly</category>
      <category>audio</category>
    </item>
    <item>
      <title>A video editor that never uploads your video: WebCodecs and Mediabunny</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:40:59 +0000</pubDate>
      <link>https://dev.to/io64bit/a-video-editor-that-never-uploads-your-video-webcodecs-and-mediabunny-74l</link>
      <guid>https://dev.to/io64bit/a-video-editor-that-never-uploads-your-video-webcodecs-and-mediabunny-74l</guid>
      <description>&lt;p&gt;I built Scissor Film, a free video editor and 20 video tools that run entirely in the browser: &lt;a href="https://film.scissor.studio" rel="noopener noreferrer"&gt;https://film.scissor.studio&lt;/a&gt;&lt;br&gt;
Your video is never uploaded. The server only serves static files, and all the work happens in your tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkr5rtd5ojhwdqahzf07d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkr5rtd5ojhwdqahzf07d.jpg" alt="The Scissor Film editor" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a timeline editor with layers, text, transitions and a screen recorder, plus single-purpose tools: compress, trim, crop, convert, join, change speed, video to GIF, add subtitles, and a few more. This post is about how it works and where it falls short.&lt;/p&gt;
&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;p&gt;No framework. The pages are plain HTML, CSS and JavaScript, rendered for 30 languages by one Node build script. The editor is about 130 KB of JavaScript (40 KB gzipped).&lt;/p&gt;

&lt;p&gt;The video work is done by open-source libraries, served from the site itself rather than a CDN:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://mediabunny.dev" rel="noopener noreferrer"&gt;Mediabunny&lt;/a&gt; 1.61.4 (MPL-2.0) reads and writes MP4, MOV, WebM and MKV, and drives WebCodecs. It is about 180 KB gzipped.&lt;/li&gt;
&lt;li&gt;@mediabunny/mp3-encoder (MPL-2.0), with LAME (LGPL-2.0) inside, for MP3 output.&lt;/li&gt;
&lt;li&gt;gifenc (MIT) for GIFs.&lt;/li&gt;
&lt;li&gt;transformers.js 4.3.2 (Apache-2.0) with ONNX Runtime Web (MIT), for the two AI tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every licence text ships with the site and is listed on its licences page.&lt;/p&gt;
&lt;h2&gt;
  
  
  How a video stays on your device
&lt;/h2&gt;

&lt;p&gt;When you open a file, the browser hands the page a &lt;code&gt;File&lt;/code&gt; object. Mediabunny reads it in slices with a &lt;code&gt;BlobSource&lt;/code&gt;, so even a large file is never read into memory all at once, and never leaves the tab. Frames are decoded by WebCodecs, the same decoders and encoders the browser uses for video calls, often on the GPU. They are changed on a canvas and encoded again.&lt;/p&gt;

&lt;p&gt;The result is either kept in memory or, for editor exports, streamed into the browser's private file system (OPFS), so a long export doesn't have to fit in RAM. Then it becomes a normal download.&lt;/p&gt;

&lt;p&gt;You can check this yourself: open the Network tab, load a video and export it. No request carries the file.&lt;/p&gt;

&lt;p&gt;Some jobs need no re-encoding at all. Converting H.264 MP4 to MOV, removing the sound, or extracting AAC audio copies the compressed packets as they are. That is fast and loses nothing. The tools try the copy first and only encode when they have to.&lt;/p&gt;
&lt;h2&gt;
  
  
  Exporting a timeline frame by frame
&lt;/h2&gt;

&lt;p&gt;The editor preview uses ordinary &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; elements, but export can't rely on playback: a slow machine would drop frames. So export decodes every clip exactly with Mediabunny and draws each output frame on a canvas, with the same code that positions clips in the preview.&lt;/p&gt;

&lt;p&gt;Browsers don't all decode everything, and a decoder can give up halfway through a clip. Safari reports that as &lt;code&gt;EncodingError: Decoder failure&lt;/code&gt;. When that happens, the export falls back to the browser's own player for the rest of that clip and seeks it frame by frame:&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="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&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;alt&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;alt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1e-3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&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="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;pull&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="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&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;err&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'EncodingError'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;stop&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="n"&gt;alt&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;player&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// a &amp;lt;video&amp;gt; element, seeked to each frame's time&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; path is slower and less exact, but it finishes the file instead of failing at 80%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Picking a codec the browser can actually encode
&lt;/h2&gt;

&lt;p&gt;Encoder support varies a lot between browsers and devices. Instead of assuming H.264, the tools ask Mediabunny for the first codec this browser can encode at this size:&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;vcodec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="no"&gt;M&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFirstEncodableVideoCodec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'webm'&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'vp9'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'vp8'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'av1'&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="s1"&gt;'avc'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'hevc'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'vp9'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'av1'&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="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If nothing on the list works, you get a plain message saying this browser can't make that format, rather than a broken file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Subtitles from speech, on the device
&lt;/h2&gt;

&lt;p&gt;Two tools use AI: one extracts subtitles from speech, the other translates them. They run Whisper (tiny, 42 MB, or base, 76 MB) and M2M-100 (418M parameters, 610 MB) with transformers.js in the browser. The models are downloaded once from the site and cached by the browser, so they work offline after that. The audio is never sent anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  The limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Codecs depend on your browser.&lt;/strong&gt; Chrome and Edge decode and encode the most. Safari and Firefox can refuse some files or formats, and the tools say so instead of guessing. HEIC photos, for example, won't open in Chrome.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory.&lt;/strong&gt; A browser tab is not a desktop app. Very long or 4K videos can run out of memory, especially on phones. Tools that rework the sound (joining, adding music) handle up to an hour of it; the speed tool handles three hours, and an editor export six.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed.&lt;/strong&gt; Export is quick when the browser encodes on the GPU, but effects that need a canvas pass on every frame are slower than in a native editor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No project saving yet.&lt;/strong&gt; A project lives in the open tab. Closing or reloading the tab clears it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it: &lt;a href="https://film.scissor.studio" rel="noopener noreferrer"&gt;https://film.scissor.studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's free, with no account and no watermark. One thing I'd like to know: if a file failed to open or export for you, which browser and which kind of file was it? That tells me which fallback to build next.&lt;/p&gt;

</description>
      <category>webcodecs</category>
      <category>javascript</category>
      <category>video</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Image tools in a 216 KB Rust WebAssembly engine, with no upload step</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:40:51 +0000</pubDate>
      <link>https://dev.to/io64bit/image-tools-in-a-216-kb-rust-webassembly-engine-with-no-upload-step-338o</link>
      <guid>https://dev.to/io64bit/image-tools-in-a-216-kb-rust-webassembly-engine-with-no-upload-step-338o</guid>
      <description>&lt;p&gt;I built Scissor Image, a set of 28 image tools that run in the browser: &lt;a href="https://image.scissor.studio/" rel="noopener noreferrer"&gt;https://image.scissor.studio/&lt;/a&gt;. Convert, compress to a size in KB, resize, crop, split, redact, remove photo location, filters and a QR code generator, in 30 languages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fknhknnqg8asoqtsxrlrk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fknhknnqg8asoqtsxrlrk.webp" alt="The Scissor Image app with the crop tool open" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The images never go to my server. The browser decodes them, a small Rust engine does the work, and the result is saved back to your device.&lt;/p&gt;

&lt;h2&gt;
  
  
  The split: the browser decodes, Rust does the rest
&lt;/h2&gt;

&lt;p&gt;I did not want to ship decoders the browser already has. So a tool starts with &lt;code&gt;createImageBitmap(file)&lt;/code&gt;, draws the bitmap on a canvas and reads the RGBA pixels. That covers JPG, PNG, WebP, AVIF and GIF, in whatever the browser supports.&lt;/p&gt;

&lt;p&gt;Everything after that happens in the engine: resize, crop, rotate and flip, the round crop for profile pictures, encoding, metadata and the ZIP for batches. It is about 1,000 lines of Rust in four files, compiled to WebAssembly with &lt;code&gt;wasm-bindgen&lt;/code&gt; and run in a Web Worker, so the page stays responsive on a large photo.&lt;/p&gt;

&lt;p&gt;The release &lt;code&gt;.wasm&lt;/code&gt; is 216 KB after &lt;code&gt;wasm-opt -Oz&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The libraries
&lt;/h2&gt;

&lt;p&gt;The engine depends on the &lt;code&gt;image&lt;/code&gt; crate 0.25, with only the &lt;code&gt;jpeg&lt;/code&gt;, &lt;code&gt;png&lt;/code&gt; and &lt;code&gt;webp&lt;/code&gt; features turned on. Through it come &lt;code&gt;zune-jpeg&lt;/code&gt;, &lt;code&gt;png&lt;/code&gt;, &lt;code&gt;image-webp&lt;/code&gt; and &lt;code&gt;miniz_oxide&lt;/code&gt;, plus &lt;code&gt;crc32fast&lt;/code&gt; for the ZIP writer. All of them are MIT or Apache-2.0, with some also under Zlib or BSD-3-Clause. The QR code tool uses &lt;code&gt;qrcode-generator&lt;/code&gt; (MIT) on the JavaScript side.&lt;/p&gt;

&lt;p&gt;The build writes every licence text into one notices file from &lt;code&gt;cargo metadata&lt;/code&gt;, and fails if a crate ships without one.&lt;/p&gt;

&lt;p&gt;One limit: the &lt;code&gt;image&lt;/code&gt; crate's WebP encoder is lossless only. So "convert to WebP" gives you a lossless WebP, which is often larger than the JPG you started from. JPG output has a quality setting; WebP does not, yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compress to an exact size in KB
&lt;/h2&gt;

&lt;p&gt;Four of the tools are "compress image to 20 KB / 50 KB / 100 KB / 200 KB", because exam and job forms ask for exactly that. A fixed quality setting does not work for this: the size depends on the photo.&lt;/p&gt;

&lt;p&gt;So the engine searches. If the photo has far more pixels than the target can hold, it first scales down to roughly 24 pixels per byte of budget. Then it does a binary search over JPEG quality 40 to 95 and keeps the highest quality that fits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;mut&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="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;40u8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;95u8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;hi&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;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&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;lo&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;jpeg&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="n"&gt;background&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;max_bytes&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="kc"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&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;q&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="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;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;q&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="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;If even quality 40 is too big, it shrinks the image by 15% and searches again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Removing location without re-compressing
&lt;/h2&gt;

&lt;p&gt;"Remove photo location" should not cost image quality. Re-encoding a JPG to drop its EXIF block would. So this tool does not touch the pixels at all: it edits the file's container. It finds the EXIF, XMP and IPTC segments, removes them, or only the GPS fields if you choose that, and copies the compressed image data across byte for byte.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the images stay on the device
&lt;/h2&gt;

&lt;p&gt;The site is static files. There is no endpoint that accepts an image, so there is nothing that could receive one. On top of that, the Content Security Policy only lets the page contact its own origin, and Google's sign-in and Drive APIs, which load only when you press Open from Drive or Save to Drive. Drive uses the &lt;code&gt;drive.file&lt;/code&gt; scope, so the site can see only files you open or create with it.&lt;/p&gt;

&lt;p&gt;The same origin also hosts a small service of mine for page counts, error reports and feedback forms. None of them carry image data or file names. The tools also work offline once the site has been opened, because a service worker stores the app and the engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  HEIC, and where it stops
&lt;/h2&gt;

&lt;p&gt;iPhone photos are HEIC: HEVC frames inside a HEIF container. HEVC is covered by patents, and I do not want to ship a decoder for it. So HEIC uses the browser's own decoder only.&lt;/p&gt;

&lt;p&gt;Safari decodes HEIC natively. In Chrome and Edge, the page reads the HEIF container itself, finds the coded tiles (iPhone photos are a grid of 512 by 512 tiles), and gives each one to WebCodecs' &lt;code&gt;VideoDecoder&lt;/code&gt;. That uses the HEVC decoder of the operating system or the GPU, which the platform has licensed. The tiles are drawn onto a canvas, then rotation, mirroring and crop are applied from the file.&lt;/p&gt;

&lt;p&gt;Firefox has no HEVC in WebCodecs, and most Linux setups do not either. There, HEIC files are turned away with a short message that explains how to get JPGs from an iPhone instead. Recent iPhones also save 10-bit HDR photos, which need hardware that can decode 10-bit HEVC.&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://image.scissor.studio/" rel="noopener noreferrer"&gt;https://image.scissor.studio/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is free, with no account and no watermark.&lt;/p&gt;

&lt;p&gt;One question for you: if you open HEIC photos in Chrome or Edge on Windows or Android, do they open, and do the colours match what you see on the iPhone?&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webassembly</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>60 PDF tools in the browser: a Rust engine in WebAssembly, no uploads</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 22:40:33 +0000</pubDate>
      <link>https://dev.to/io64bit/60-pdf-tools-in-the-browser-a-rust-engine-in-webassembly-no-uploads-1pk9</link>
      <guid>https://dev.to/io64bit/60-pdf-tools-in-the-browser-a-rust-engine-in-webassembly-no-uploads-1pk9</guid>
      <description>&lt;p&gt;I built Scissor PDF, a set of 60 PDF tools that run entirely in your browser: &lt;a href="https://pdf.scissor.studio" rel="noopener noreferrer"&gt;https://pdf.scissor.studio&lt;/a&gt;&lt;br&gt;
You pick a file, the tool runs on your device, and you download the result. Nothing is sent to a server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fibnytwfsxg9on6do9hh3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fibnytwfsxg9on6do9hh3.jpg" alt="The Scissor PDF app with its list of tools" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post is about how it works, what it is built on, and where it still falls short.&lt;/p&gt;
&lt;h2&gt;
  
  
  The engine: Rust and lopdf, compiled to WebAssembly
&lt;/h2&gt;

&lt;p&gt;The PDF work is done by a small Rust crate built on &lt;a href="https://github.com/J-F-Liu/lopdf" rel="noopener noreferrer"&gt;lopdf&lt;/a&gt; (MIT). It merges, splits, rotates, crops, numbers pages, adds watermarks, flattens, and adds or removes passwords. The &lt;code&gt;image&lt;/code&gt; crate (MIT/Apache-2.0) handles JPEG and PNG when photos are re-encoded or placed on pages.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wasm-bindgen&lt;/code&gt; turns it into a module the page can call. The compiled engine is 1.4 MB, about 600 KB with gzip. It runs in a Web Worker, so the page stays responsive while a 300-page file is processed.&lt;/p&gt;

&lt;p&gt;Every tool page loads the same engine. The browser caches it, so after the first tool the next one starts at once.&lt;/p&gt;
&lt;h2&gt;
  
  
  Rendering and OCR: PDF.js and Tesseract
&lt;/h2&gt;

&lt;p&gt;The engine edits PDFs but does not draw them. Previews, thumbnails and the PDF to image tools use &lt;a href="https://github.com/mozilla/pdf.js" rel="noopener noreferrer"&gt;PDF.js&lt;/a&gt; (Apache-2.0), served from the same site. Form filling uses PDF.js too: you type into its form layer, and it saves the values back into the file.&lt;/p&gt;

&lt;p&gt;OCR uses &lt;a href="https://github.com/naptha/tesseract.js" rel="noopener noreferrer"&gt;Tesseract.js&lt;/a&gt; (Apache-2.0). Each page is rendered at up to 300 dpi, read by Tesseract, and the words are written back as an invisible text layer. The page looks exactly the same, but you can now search and copy the text. The language model is downloaded only for the language you choose, and only when you start OCR.&lt;/p&gt;

&lt;p&gt;Compression is plain and predictable. Every level removes unused objects and packs the file into compressed object streams. The stronger levels also re-encode large photos as JPEG, at most 2200 pixels on the long side for "Recommended" and 1400 for "Strong". Text and vector graphics are never turned into images.&lt;/p&gt;
&lt;h2&gt;
  
  
  How files stay on the device
&lt;/h2&gt;

&lt;p&gt;"We don't upload your files" is easy to claim, so I made the browser enforce it. Tool pages send this Content Security Policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; connect-src 'self' blob: data:; form-action 'none'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;connect-src 'self'&lt;/code&gt;, the page cannot &lt;code&gt;fetch&lt;/code&gt; or &lt;code&gt;XMLHttpRequest&lt;/code&gt; to any other origin, and &lt;code&gt;form-action 'none'&lt;/code&gt; blocks form posts. You can check this yourself: open the network tab in the developer tools, run a tool, and watch. The only requests go to the site's own scripts and fonts.&lt;/p&gt;

&lt;p&gt;The full app at /app/ has one exception: an optional "Open from / Save to Google Drive" button. That page also allows Google's API hosts, and only for files you explicitly pick in Drive.&lt;/p&gt;

&lt;h2&gt;
  
  
  The limit: memory on large files
&lt;/h2&gt;

&lt;p&gt;The honest weak spot is memory. WebAssembly in the browser gets one linear memory, and the file has to fit in it, sometimes several times over: the original bytes, the parsed document, and the result being written.&lt;/p&gt;

&lt;p&gt;In my tests in desktop Chrome, split by size failed at around 1 GB of PDF. Phones give a tab much less memory and fail far sooner.&lt;/p&gt;

&lt;p&gt;A recent fix made this much better for the split tools. Each part used to start from a full clone of the document, every image and font included, before anything was removed. Now the clone starts without stream data, and only the streams the part keeps are copied back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;part&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Res&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;light_clone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// dictionaries only, streams empty&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;page_ids&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;d&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;chosen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ObjectId&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iter&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="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;usize&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="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collect&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="nf"&gt;set_page_list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;chosen&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prune_objects&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;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iter_mut&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;if&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full&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="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;id&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="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clone&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="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&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;When a file is still too big, the worker catches the crash, says so plainly, and starts a fresh engine. You can close other tabs or try a smaller file without reloading the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built as a static site
&lt;/h2&gt;

&lt;p&gt;There is no backend for the tools. The site is 66 pages in 30 languages, generated by one Node build script and served as static files. The app works offline once it is installed. Crash reports and anonymous usage counts go to my own analytics, and they carry an error code and a stack, never file names or contents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Try it: &lt;a href="https://pdf.scissor.studio" rel="noopener noreferrer"&gt;https://pdf.scissor.studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's free, with no account, no sign-up and no watermark.&lt;/p&gt;

&lt;p&gt;One question for you: what is the largest PDF you need to handle in a browser, and on what device? I want to know where the memory limit actually hurts people, before deciding whether to stream files through the engine in chunks.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webassembly</category>
      <category>pdf</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Solitaire with 3D card physics in Rust and WebGL 2, no game engine</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Tue, 24 Nov 2026 19:30:32 +0000</pubDate>
      <link>https://dev.to/io64bit/solitaire-with-3d-card-physics-in-rust-and-webgl-2-no-game-engine-3717</link>
      <guid>https://dev.to/io64bit/solitaire-with-3d-card-physics-in-rust-and-webgl-2-no-game-engine-3717</guid>
      <description>&lt;p&gt;I put 23 card and board games in the browser: &lt;a href="https://games.scissor.studio/" rel="noopener noreferrer"&gt;Scissor Games&lt;/a&gt;. They are written in Rust, compiled to WebAssembly and drawn with WebGL 2. There is no game engine in it and no physics engine either.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxq8j49ix378wn3khhj1t.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxq8j49ix378wn3khhj1t.gif" alt="A deal of Solitaire, then the last cards go up and the deck flies apart" width="640" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is in it
&lt;/h2&gt;

&lt;p&gt;There are 17 kinds of solitaire (Klondike, Spider, FreeCell, Pyramid, Golf, Yukon and others) and six board games: Chess, Checkers, Backgammon, Mahjong, Sudoku and Minesweeper.&lt;/p&gt;

&lt;p&gt;All 23 run from one wasm file. It is 1.16 MB on disk and about 570 KB over the network with Brotli. The Rust is about 12,400 lines.&lt;/p&gt;

&lt;p&gt;The dependency list is short:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[dependencies]&lt;/span&gt;
&lt;span class="na"&gt;wasm-bindgen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"=0.2.129"&lt;/span&gt;
&lt;span class="na"&gt;js-sys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.3"&lt;/span&gt;
&lt;span class="na"&gt;web-sys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.3"&lt;/span&gt;
&lt;span class="na"&gt;glam&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.34"&lt;/span&gt;
&lt;span class="na"&gt;console_error_panic_hook&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;glam&lt;/code&gt; does the vector maths. Everything that touches the page or the GPU goes through &lt;code&gt;web-sys&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cards on springs
&lt;/h2&gt;

&lt;p&gt;Each card has a place it wants to be and a spring that pulls it there. A card at rest uses a stiffness of 160. When you drag a run of cards, the first one follows the pointer with a stiffness of 700, and each card behind it gets less:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;700.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;f32&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;That is why a dragged run trails behind the pointer.&lt;/p&gt;

&lt;p&gt;When you win, the springs are switched off. Every card gets a random spin and is let go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;physics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;spin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Vec3&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;4.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;9.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;9.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;9.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;9.0&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  One table, many games
&lt;/h2&gt;

&lt;p&gt;The 17 card games share one scene. A game is a type that implements a &lt;code&gt;Rules&lt;/code&gt; trait: where the piles sit (&lt;code&gt;slots&lt;/code&gt;), which cards may be picked up (&lt;code&gt;can_pick&lt;/code&gt;), where they may be dropped (&lt;code&gt;can_drop&lt;/code&gt;), and so on. The scene knows nothing about Klondike or Spider. The board games each have a scene of their own.&lt;/p&gt;

&lt;h2&gt;
  
  
  No text in the engine
&lt;/h2&gt;

&lt;p&gt;The engine draws no text. Card faces are painted once with a 2D canvas into a sheet of 9 by 6 cards, 455 x 637 pixels each, and uploaded as one texture. The counters, the buttons and the result card are ordinary HTML over the canvas. That is how the site comes in 30 languages, right-to-left ones included, without a font renderer in the wasm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shadows
&lt;/h2&gt;

&lt;p&gt;Cards cast soft shadows. The table shader looks up a shadow map, searches 16 Poisson samples for blockers, then takes 16 more with a radius that grows with the distance to the blocker. A card lifted off the table gets a wider, softer shadow than one lying flat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phones
&lt;/h2&gt;

&lt;p&gt;On a phone the buttons fold into a menu, and there is a large-print deck with bigger numbers for small screens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://games.scissor.studio/solitaire/" rel="noopener noreferrer"&gt;games.scissor.studio/solitaire&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is free, with no account and no ads. Each card game has a deal of the day that is the same for everyone.&lt;/p&gt;

&lt;p&gt;I would like to hear where it feels wrong, especially on phones.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webassembly</category>
      <category>webgl</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>I built a browser-based vector editor without AI features</title>
      <dc:creator>Sia </dc:creator>
      <pubDate>Wed, 23 Sep 2026 20:51:39 +0000</pubDate>
      <link>https://dev.to/io64bit/i-built-a-browser-based-vector-editor-without-ai-1di9</link>
      <guid>https://dev.to/io64bit/i-built-a-browser-based-vector-editor-without-ai-1di9</guid>
      <description>&lt;p&gt;I wanted a vector editor that I could open in my browser and just use .&lt;/p&gt;

&lt;p&gt;No AI generating things for me, No prompts. No "let AI design it." (tbf it's not that cheap also to offer that for free)&lt;/p&gt;

&lt;p&gt;Just a vector editor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0zw9txvux5dfc5ml7kyy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0zw9txvux5dfc5ml7kyy.png" alt=" " width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So I built Scissor.
&lt;/h2&gt;

&lt;p&gt;Try it: &lt;a href="https://scissor.studio" rel="noopener noreferrer"&gt;https://scissor.studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initially I wanted to call it OpenScissor and make it open source, but hey I don't want Microsft to train their agens on.&lt;/p&gt;

&lt;p&gt;It has the usual stuff you'd expect, shapes, paths, text, layers, etc; but the main idea is pretty simple:&lt;/p&gt;

&lt;p&gt;You make the design.&lt;/p&gt;

&lt;p&gt;I don't use vector graphics software professionally; so , I didn't really want a massive application with hundreds of features that I'd probably never touch&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it?
&lt;/h2&gt;

&lt;p&gt;It feels like every creative tool is adding AI to everything these days.&lt;br&gt;
That's not really what I'm looking for.&lt;/p&gt;

&lt;p&gt;Sometimes I just want to move some points around, tweak a path, draw a shape, mess around with an idea, and actually make it myself.&lt;/p&gt;

&lt;p&gt;That's what I'm trying to do with Scissor.&lt;/p&gt;

&lt;p&gt;It's not trying to replace every professional workflow. It's just a vector editor that stays out of the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Did I used ai to building it?
&lt;/h2&gt;

&lt;p&gt;Heck yeah I did, judge me ... hate me or ..., for me it's another tool and I like using new shiny things.. .&lt;/p&gt;

&lt;h2&gt;
  
  
  I'd love some feedback
&lt;/h2&gt;

&lt;p&gt;If you work with SVGs, illustrations, icons, or just occasionally need a vector editor, I'd love to know what you think.&lt;/p&gt;

&lt;p&gt;What features are missing?&lt;/p&gt;

&lt;p&gt;What's annoying?&lt;/p&gt;

&lt;p&gt;What would make you actually use a browser-based vector editor?&lt;/p&gt;

&lt;p&gt;And if you try it, I'd especially like to know what feels unnecessarily complicated&lt;/p&gt;

&lt;p&gt;Scissor: &lt;a href="https://scissor.studio" rel="noopener noreferrer"&gt;https://scissor.studio&lt;/a&gt;&lt;/p&gt;

</description>
      <category>design</category>
      <category>graphics</category>
      <category>webassembly</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
