The HTML5 Canvas API as our processing engine
Image Prep Kit relies primarily on the HTML5 Canvas API, a browser-native interface that has been standard in all modern browsers for over a decade. When you drop an image onto one of our tools, the browser decodes it into a bitmap using its built-in image decoders—libjpeg for JPEG, libpng for PNG, and libwebp for WebP. The decoded pixel data is then drawn onto a canvas element, which gives us a 2D pixel array that we can manipulate directly using JavaScript.
For compression, we use the canvas toDataURL and toBlob methods with quality parameters. These methods invoke the browser's native encoder libraries, which are highly optimized C implementations compiled to WebAssembly or running natively in the browser engine. The quality parameter (0.0 to 1.0) controls the compression level for lossy formats like JPEG and WebP. For PNG, the browser handles the zlib compression internally, and we can choose between 24-bit truecolor and 8-bit indexed color modes depending on the tool's requirements.
This architecture means that our performance is actually tied to the browser's performance. In modern browsers like Chrome, Firefox, Safari, and Edge, the image processing happens on the same thread that renders the page, but because the heavy lifting is done by native compiled code rather than JavaScript, even large images process within milliseconds. A 10-megapixel JPEG image typically decodes, resizes, and re-encodes in under one second on a modern laptop or desktop computer.
File System Access API for reliable downloads
One of the subtle challenges of browser-only image processing is getting the processed file back to the user's device reliably. Early implementations relied on creating anchor tags with download attributes and programmatically clicking them, which works but is limited by browser security policies and does not allow the user to choose the save location. Image Prep Kit uses the File System Access API where available, which provides a native file picker dialog that lets users choose exactly where to save their processed image.
On browsers that do not yet support the File System Access API—primarily older Safari versions and some mobile browsers—we fall back to the traditional download attribute approach. This dual strategy ensures that the tools work on virtually any modern device while providing the best possible experience on supported browsers. The fallback is transparent to the user; they simply see a save dialog or an automatic download depending on their browser capabilities.
Importantly, because the entire pipeline is client-side, the processed image never exists as a file on our server. Even if we wanted to retain copies of user images, we have no mechanism to do so. The image is decoded in memory, processed on the canvas, encoded into the target format, and immediately offered as a download. When the user navigates away from the page or closes the tab, the browser's garbage collector removes the pixel data from memory. This is fundamentally different from server-based tools, where the file must be uploaded, stored temporarily on disk, processed, and then served back to the user.
Format support and browser differences
Browser support for image formats varies, and this directly affects what Image Prep Kit can offer. All modern browsers support PNG, JPEG, GIF, WebP, and BMP. WebP support is nearly universal in current browsers but was absent in older Safari versions before iOS 14 and macOS Big Sur. HEIC/HEIF support is more limited—Chrome and Firefox can decode HEIC images on some platforms, but Safari has the most robust support because Apple developed the format. This means our HEIC conversion tool works best on Apple devices, though recent updates to Chrome have improved cross-platform HEIC support.
AVIF, a newer format promising even better compression than WebP, is supported in Chrome, Firefox, and Safari, but implementation maturity varies. We do not currently offer AVIF conversion because the browser encoder support is still inconsistent, and the resulting files might not be decodable by the user or the platforms they intend to upload to. As AVIF support stabilizes across all major browsers, we will evaluate adding it as a conversion target. This conservative approach to format support ensures that every output from our tools is usable by the recipient, whether that is a social media platform, a website CMS, or a print service.