🏪 Lanren Toolkit

🖼️ Image Compressor / Format Converter

Choose an image, adjust the output format and compression quality, and download instantly. Everything is processed right in your browser — images are never uploaded to any server.

Ad・Leaderboard 728×90
Ad・Rectangle 336×280

📖 How to Use

  1. Choose an image by clicking "Choose an image" and selecting a JPG, PNG, WebP, or other browser-supported image file.
  2. Pick an output format: JPG, WebP, or PNG. The image is automatically recompressed and the preview updates as soon as you choose — no button needed.
  3. Adjust the quality slider (1–100%): lower values mean a smaller file but lower image quality. If you select PNG, the slider is disabled since PNG is lossless and quality doesn't apply.
  4. Compare the results: the "Original image" and "Compressed preview" panels sit side by side, each showing its file size and dimensions, with a percentage below indicating how much smaller (or larger) the output is.
  5. Download the result by clicking "Download compressed image" — the file extension automatically matches your chosen format (.jpg/.webp/.png).
Note: The entire compression and format conversion happens locally in your browser using the Canvas API — your image is never uploaded to any server, which makes this a safe option for photos with personal or sensitive content. One thing to watch for: converting an already-compressed JPG to PNG usually makes the file bigger (since PNG is lossless), and the tool will flag this with an "Increased by N%" message — in that case, stick with JPG or try WebP instead.

📖 Deep Dive: Lossy Compression, Lossless Formats, and How to Choose

What is "compression" actually doing? Lossy vs. lossless

Image compression works in one of two fundamentally different ways: lossless or lossy. PNG is a lossless format — it mathematically re-encodes pixel data to shrink the file, but every pixel you get back is byte-for-byte identical to the original, with zero quality loss. That's exactly why this tool disables the quality slider when PNG is selected: PNG has no "quality" knob to turn, and its file size depends entirely on the image content itself (flat-color graphics compress tiny, while noisy or gradient-heavy photos barely shrink at all). JPG and WebP, by contrast, are lossy formats — they discard high-frequency detail the human eye is less sensitive to (sharp color-transition edges, fine noise texture) in exchange for a smaller file. The lower the quality slider, the more detail gets discarded and the smaller the file gets, at the cost of visible blockiness or blur.

JPG, PNG, or WebP — which one should you pick?

Photos, landscapes, and portraits with rich color gradients and complex detail compress best as JPG or WebP — lossy compression is most efficient on this kind of content, and the eye rarely notices the simplified detail. Images with large flat-color areas, text, line art, logos, or a need for transparency (screenshots, icons, cutout graphics) are better as PNG, since lossy compression tends to produce ugly blocky artifacts around sharp text edges. WebP is a newer format that supports both lossy and lossless modes, typically producing files 25–35% smaller than JPG at equivalent quality while also supporting transparency — it's currently the most efficient general-purpose format, though a handful of very old software or email clients may not open WebP files, which is when falling back to JPG or PNG makes sense.

Why does converting a JPG to PNG make the file bigger, not smaller?

This is the most common trigger for this tool's "increased" message. A JPG has already been shrunk with lossy compression, so when you convert it to PNG, the PNG encoder can only losslessly repackage the pixel data that came out of decoding the JPG — and the noise and blocky edges left behind by JPG compression actually make lossless compression less effective, sometimes producing a file larger than the original JPG. This isn't a bug in the tool; it's just how the formats work. A lossless format can't undo quality that's already been lost — it can only faithfully preserve whatever pixel data (flaws included) it's given.

Worked example: how does the quality number affect file size on the same photo?

Take a 2MB, 4000×3000 pixel portrait photo as an example. Exporting as JPG at 90% quality typically lands around 800KB–1.2MB with almost no visible difference from the original. Drop the quality to 60% and the file might shrink further to 300–500KB, but look closely and you'll start to see faint blockiness in large gradient areas like skin tones or sky. Below 20%, the blockiness becomes obvious and facial detail blurs noticeably. That's why this tool defaults to 80% quality — a reasonably balanced starting point between file size and visual quality. Drag the slider while watching the side-by-side preview to find the threshold you're comfortable with.

❓ FAQ

Does the image I upload get stored on a server?

No. The entire compression process uses the browser's built-in Canvas API and runs locally on your device — reading the file, drawing it to a canvas, converting the format, and encoding the output all happen in your browser's memory. There's no fetch call or upload logic anywhere in the code, so your image never leaves your device, making this safe for photos containing personal data, ID documents, or confidential material.

Why does the quality slider disappear when I choose PNG?

Because PNG is a lossless format with no "quality" concept to adjust — the slider value has no effect on PNG output at all, so the tool automatically hides it and shows an explanatory note instead. PNG output size depends purely on how visually complex the image itself is.

It says "Increased by N%" — did compression fail?

No, that's expected behavior given how the formats work. The most common cause is converting an already-lossy JPG into lossless PNG, or setting the quality slider high enough that compression barely does anything. In these cases the tool honestly reports the size increase — try switching back to the original format or using WebP instead.

Does this tool change the image's pixel dimensions?

No — this tool only changes the compression method and file format, never the width or height in pixels. The original and compressed preview will always show the same dimensions; only the file size (KB/MB) changes.

Can WebP files be opened everywhere?

Most modern browsers and operating systems support WebP today, but a small number of older software packages, some email clients, or certain office systems may not open WebP images directly. If you're unsure whether your target audience can open WebP, JPG (for photos) or PNG (for transparency or line art) remain the safest, most widely compatible choices.

Ad・Leaderboard 728×90