# Image Compressor & Converter - JPG, PNG, WebP

Page: https://hirantha.me/tools/image
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-07-31

Shrink a photo or convert it between JPG, PNG, and WebP.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Compress a photo or convert it between JPG, PNG, and WebP without uploading it anywhere. Pick a quality level, optionally cap the longest side, and download - processing runs on a background thread in your browser using the same canvas APIs a native app would use.

The image is decoded and drawn to an off-screen canvas, respecting the orientation stored in the file's metadata so portrait phone photos don't come out sideways.

JPEG and WebP are lossy formats - lowering the quality setting throws away visual detail your eye is less likely to notice, at the cost of it becoming visible on close inspection or heavy cropping. PNG is lossless, so its size only changes from resizing or switching format.

If your browser can't encode WebP natively, a small WebAssembly encoder loads automatically as a fallback - detected with a real encode test, not by checking which browser you're using.

Which output format to pick:
| Format | Lossy | Transparency | Best for |
| --- | --- | --- | --- |
| JPEG | Yes | No - filled white | Photographs, camera images, anything without transparency |
| PNG | No | Yes | Screenshots, logos, line art, images with sharp edges or flat colour |
| WebP | Yes | Yes | Almost everything on the web - smaller than both at similar quality |
| Keep original | Unchanged | Unchanged | Resizing or recompressing without switching format |

Q: Is my photo uploaded anywhere?
A: No. The file is read directly from your device, decoded and re-encoded in your browser tab, and never leaves it.

Q: Will my portrait photo come out sideways?
A: No - the tool reads the orientation tag stored in the photo and corrects it before drawing, a step a surprising number of free compressors skip.

Q: What's the difference between JPEG and WebP?
A: Both are lossy, but WebP generally holds more detail at the same file size, especially for photos with flat colour or fine text. JPEG has near-universal compatibility; WebP is supported by every current browser but occasionally trips up older software.

Q: Why did my PNG get bigger instead of smaller?
A: PNG is lossless, so if the source is already well-compressed, re-encoding it can add a few bytes of overhead. The tool detects this and keeps the original file rather than handing you a larger one.

Q: Does it keep my photo's location and camera data (EXIF)?
A: Re-encoding through canvas strips EXIF metadata, including GPS location, automatically as a side effect.

Q: Does it support HEIC (iPhone photos)?
A: Not for conversion yet - the tool detects HEIC files and tells you directly rather than failing silently. A dedicated HEIC to JPG converter is planned.

Q: Is there a file size or batch limit?
A: You can queue multiple images at once. The practical limit is your device's memory, not an arbitrary cap - very large batches on an older phone may need to be split up.

Q: What quality setting should I use?
A: 82% is the default and is close to the point where lowering it further starts to show. Around 70% is still respectable for web use; below about 50% the artefacts become obvious.

Q: Why does the same quality setting save more on one photo than another?
A: JPEG compresses smooth areas far better than detailed ones. A photo of a clear sky shrinks dramatically; dense foliage or film grain barely compresses at all.

Sources: Image file type and format guide - MDN (https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types); createImageBitmap() - MDN (https://developer.mozilla.org/en-US/docs/Web/API/createImageBitmap); HEIF / HEIC format (https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format)

Related tools:

- [Video compressor](https://hirantha.me/tools/video.md): Shrink a video so it's small enough to email or message.
- [Audio trimmer](https://hirantha.me/tools/audio.md): Cut a section from an audio file and convert it to MP3, M4A, or WAV.
- [PNG to JPG converter](https://hirantha.me/tools/png-to-jpg.md): Convert PNG images to JPG, free and in your browser.
- [Background remover](https://hirantha.me/tools/background-remover.md): Remove the background from a photo of a person.
- [Extract text (OCR)](https://hirantha.me/tools/ocr.md): Pull copyable text out of a photo or scan.
- [Rotate and flip an image](https://hirantha.me/tools/image-rotate-flip.md): Rotate a photo 90, 180 or any angle, flip it left to right or top to bottom, preview it live and save it as PNG, JPEG or WebP. Nothing is uploaded.
- [Image filters and adjustments](https://hirantha.me/tools/image-filters.md): Adjust brightness, contrast, saturation, hue, grayscale, sepia, invert and blur with a live before and after view. Same result in every browser.
