What is JPEG compression?
JPEG (Joint Photographic Experts Group) compression reduces file size by selectively discarding visual information that the human eye is less sensitive to. It's a lossy compression method — some data is permanently removed each time you save.
The magic lies in a mathematical technique called the Discrete Cosine Transform (DCT), which converts pixel data into frequency data. High-frequency detail (fine textures) can be discarded with minimal visual impact.
The compression pipeline
- Colour space conversion: RGB is converted to YCbCr (luminance + chrominance). The human eye is more sensitive to brightness than colour, so chrominance can be downsampled.
- Block division: The image is divided into 8×8 pixel blocks.
- DCT transform: Each block is converted from spatial domain to frequency domain.
- Quantisation: This is where compression happens. High-frequency coefficients are rounded or zeroed out based on the quality level.
- Encoding: The remaining data is compressed using Huffman coding.
Quality levels: What the numbers mean
| Quality | File size reduction | Visual impact | Best for |
|---|---|---|---|
| 95–100% | Minimal (2–3×) | Virtually identical to original | Professional photography |
| 80–90% | Moderate (5–10×) | Barely noticeable | Web images, documents |
| 60–75% | Significant (10–20×) | Visible on close inspection | Thumbnails, previews |
| Below 50% | Extreme (20–50×) | Obvious artefacts | Very small file size needs |
For passport and exam photos, 80–90% quality is the sweet spot — small enough for upload limits while maintaining clarity. Use PhotoResizer.in to compress to exact KB targets.
Re-compression: Why saving JPEG multiple times is bad
Each time you open, edit, and re-save a JPEG, it goes through the compression pipeline again. This is called generation loss. After 5–10 re-saves, visible artefacts accumulate, especially around high-contrast edges.
Best practice: Always edit from the original file, and only save the final output as JPEG. If you need to make multiple edits, work in PNG or TIFF until the final export.
Technical Verification & Standards Compliance for Digital Submissions
When uploading photographs, signatures, or official records to government portals, visa processing systems, or recruitment boards, strict automated validation scripts evaluate both visual clarity and physical file parameters. Minor errors—such as non-standard aspect ratios, improper pixel dimensions, high compression artifacts, or unstripped EXIF headers—frequently trigger instant system rejections.
Image Dimension & Aspect Ratio Math
Official forms specify exact physical measurements (e.g., 3.5cm × 4.5cm) or pixel boundaries (e.g., 350×450px). Converting physical units into digital resolution requires applying exact DPI scales: Pixels = (Millimeters / 25.4) × DPI.
Local WebBrowser Compression Engine
PhotoResizer.in uses client-side HTML5 Canvas and WebAssembly algorithms to compress image streams down to specific KB limits (10KB, 20KB, 50KB, 100KB, 200KB) entirely inside your web browser. Visual data never leaves your device.
