Weekend build: Free local first image conversion in the browser
While working on makemap.co I wanted to update some pictures and had to convert some images to webp format. Since it was only a handful of images, I did it manually using one of the first search results that popped up on Google.
Only afterward did I ask myself: did I just upload an image to a server? I went back to check what happens on the network tab in the developer console when converting an image. And to my surprise (and also not), the image was indeed uploaded.
Almost all results on the first pages of search results uploaded files to their servers for processing. This raised privacy concerns for me, especially when dealing with personal or sensitive images.
The WebAssembly Revelation
I wondered with the recent WebAssembly advancements if it must be possible to do almost all file conversions locally in the browser. I was almost certain that file manipulation tools have already been compiled or ported to WebAssembly.
A quick search later, I found that both libvips (powering Sharp, which powers Next.js image optimization) and ImageMagick already have WebAssembly versions. This was exciting news!
With this discovery, I came to the conclusion it would make for a great small weekend build project and got working. The result you can see at convertlocal.app for yourself.
Building a Local-First Conversion Tool
The core principle behind convertlocal.app is simple: all processing happens directly in your browser. When you upload an image, the file is read into memory in your browser, a Web Worker is started to perform the file conversion using the WebAssembly module and the result is saved back to your device.
Current Features
The current version of convertlocal.app supports common image conversion formats:
- Convert to WebP, PNG, JPEG, and other common formats
- Adjust quality settings for lossy formats
- Preserve metadata options
- Batch processing of multiple files
The tool is completely free to use and with no ads. It's a simple utility that does one thing well - convert your images locally.
Long-Term Plans
While the current version focuses on common image conversions, I have several plans for the future:
- Support for HEIC (High Efficiency Image Format) commonly used by iPhones
- Expand beyond images to support other file types like documents and audio
- Build a Raycast plugin that utilizes the same WebAssembly modules for file conversion directly from your desktop
Why This Matters
In an era where data privacy is increasingly important, tools that process data locally rather than sending it to unknown servers provide a valuable alternative. While there are legitimate use cases for server-side processing (like when you need more computing power than the client device can provide), many common tasks can now be handled locally thanks to technologies like WebAssembly.
This small weekend project demonstrates how modern web technologies can be leveraged to create useful tools that respect user privacy while still providing powerful functionality.
If you need to convert images, give convertlocal.app a try, and feel free to share feedback or feature requests!