DiceXDiceX/ Blog

Compress images without uploading them: a guide to in-browser compression with Pixel

You can compress JPEG, PNG, WebP, AVIF, SVG and HEIC images without sending them to anyone's server. Here is how in-browser compression works, how to use DiceX Pixel step by step, and which format to choose.

6 min read

To compress images without uploading them, use a tool that runs the compression inside your own browser. DiceX's Pixel does exactly that: it compresses JPEG, PNG, WebP, AVIF, SVG and HEIC images with a WebAssembly engine (MozJPEG and libwebp among its codecs), entirely in your browser, with no upload. You choose the output format and quality, can resize or cap the file size, compare before and after, and download the result. This guide explains how it works, walks through Pixel step by step, and helps you pick a format.

Why compress images without uploading them

Most online image compressors work by sending your file to a server, compressing it there, and sending it back. That is fine for a holiday photo. It is less fine for an unreleased product shot, a contract scan, a client's logo or an internal screenshot. DiceX's design tools start from a simple idea: compress images and find icons without uploading your company's files to unknown websites. In-browser compression has two practical benefits:

  • The file stays on your device. The image is decoded, re-encoded and saved by your browser. Nothing has to be sent anywhere to be compressed.
  • No upload step. Large files do not have to travel to a server and back before you see a result.

How in-browser image compression works

A browser cannot natively write a well-compressed JPEG or AVIF. Pixel fills that gap with WebAssembly (WASM): the same image codecs used by desktop tools, compiled to run inside a web page.

  1. Decode. Pixel opens your image into raw pixels. HEIC photos are decoded with a WASM HEIC decoder.
  2. Resize (optional). If you set a maximum width and height, the image is scaled to fit.
  3. Encode. The pixels are written in the format you choose: MozJPEG for JPEG, libwebp for WebP, an AVIF encoder for AVIF, and a PNG encoder with lossless optimisation for PNG.
  4. Hand back. You get the new file, its size and the saving, ready to download. The heavy work runs in a Web Worker, so the page stays responsive while images are processed. SVG files take a separate path: they are optimised as SVG and stay vector.

How to compress images in Pixel, step by step

  1. Open Pixel at pixel.tools.dicex.me and choose the Optimizer.
  2. Drop your images on the page, or click to choose files. You can add several at once; they go into a processing queue.
  3. Set the output. In Output settings, choose:
  • Output format: keep the original format, or convert to JPEG, PNG, WebP or AVIF.
  • Quality: a percentage; the default is 75%.
  • Resize: turn it on and set a maximum width and height (2048 by 2048 pixels by default).
  • Limit output size: set a maximum size in KB, and Pixel lowers the quality until the file fits.
  1. Start optimizing. Each file shows its progress, and the queue shows the total saved.
  2. Compare. Open the before/after comparison and drag the line across the image to check the quality.
  3. Download each file, or download all as one ZIP file. To try the codecs before opening Pixel, the DiceX Tools page has a live sample: move the quality, drag the line in the middle, and drop your own PNG, JPEG or WebP image.

Which format should you choose?

Output

Best for

Notes

Keep original

Making existing files lighter without changing how they are used

A HEIC photo is saved as JPEG

JPEG

Photos that must open everywhere

No transparency; a transparent background turns white

WebP

Website images, photos and graphics

Supports transparency; often smaller than JPEG or PNG

AVIF

Often the smallest files, for modern browsers and apps

Supports transparency; usually slower to encode

PNG

Screenshots, flat graphics, images that must stay lossless

Lossless, so size limits do not apply

| SVG (input) | Logos, icons, illustrations | Optimised and kept as SVG | A simple rule: for a website, try WebP first and compare it with AVIF; for an attachment that must open anywhere, use JPEG; for screenshots with text, compare PNG with WebP.

Hitting a size limit

Forms, marketplaces and email systems often reject files above a certain size. Turn on Limit output size, enter the limit in KB, and choose JPEG, WebP or AVIF. Pixel searches for the highest quality that still fits under the limit. With PNG this setting has no effect, because PNG is lossless.

Photos from an iPhone (HEIC)

Many phones save photos as HEIC, which some websites and programs do not accept. Drop the HEIC file into Pixel and keep the original format to get a JPEG, or choose WebP or AVIF for a smaller file.

Checking quality in the before/after view

The comparison is where you decide whether a setting is good enough. Drag the line slowly and look at the places compression shows first:

  • Text and thin lines. Screenshots and diagrams blur or gain halos at low quality. If the text looks soft, raise the quality or try PNG or WebP.
  • Smooth gradients. Skies, shadows and soft backgrounds can show bands. Raise the quality a few points and compare again.
  • Edges of transparent areas. Logos and product cut-outs should keep clean edges; use WebP, AVIF or PNG, not JPEG.
  • Faces and fine texture. Skin, hair and fabric are where a photo looks "processed" first. Start at the default 75%, check these four places, and only go lower if the image still looks right. The saving shown in the queue tells you whether a lower setting is worth it.

When lighter images matter most

  • Websites and shops. Smaller images make pages lighter to load, especially on mobile connections.
  • Email and chat attachments. Many systems cap attachment size; a lighter image goes through the first time.
  • Forms and portals. Upload fields often accept only files under a set size.
  • Archives and shared drives. Large photo folders take less space after compression.

Limits to know

Pixel is straightforward, but a few limits are worth knowing in advance:

  • Very large files. Pixel's optimizer takes files up to 100 MB, so the browser tab stays responsive. The quick sample on tools.dicex.me takes images up to 30 MB.
  • PNG and size limits. PNG is lossless; for a guaranteed size reduction, choose WebP or AVIF.
  • Browser support. The codecs need a browser that can run WebAssembly in a Web Worker. If they cannot run, Pixel says so; check the connection and open the page again, or try another browser.
  • JPEG has no transparency. Converting a transparent PNG to JPEG gives it a white background.

Beyond compression: icons

Pixel also has an icon studio that turns an SVG or an image into a clean, Iconify-ready icon, and DiceX runs icons.dicex.me, a search across every Iconify set plus DiceX's own. Read how to find and export Iconify icons for that side of the toolkit. The DiceX Design UI library, the one every DiceX panel is built with, is shown on tools.dicex.me and will be installable soon.

Next step

Open Pixel, drop one image you would normally upload to a compressor, and compare WebP and AVIF at the default 75% quality. For everything DiceX publishes about these tools, see the design tools hub; developers can find more on the developers hub.

Frequently asked questions

Can I compress images without uploading them?

Yes. Pixel compresses images inside your browser with codecs compiled to WebAssembly, so the image is processed on your own device and is not uploaded.

Which formats does Pixel accept?

JPEG, PNG, WebP, AVIF, SVG and HEIC. Output can keep the original format or be JPEG, PNG, WebP or AVIF; SVG files are optimised and stay SVG.

Why does my PNG not get smaller when I set a size limit?

PNG is a lossless format, so size limits do not apply to it. For a guaranteed size reduction, choose WebP or AVIF as the output format.

What happens to iPhone HEIC photos?

Pixel opens HEIC files in the browser. If you keep the original format, a HEIC photo is saved as JPEG; you can also choose WebP, AVIF or PNG.

Can I compress several images at once?

Yes. Drop several images on Pixel; they go into a processing queue that shows the total saved, and you can download them all as one ZIP file.

Guides

Related articles