惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
小众软件
小众软件
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
有赞技术团队
有赞技术团队
J
Java Code Geeks
WordPress大学
WordPress大学
The Cloudflare Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Image Compression for People Who Just Want Smaller Photos
xiaojia7788 · 2026-05-16 · via DEV Community

xiaojia7788

Most email providers cap attachments at 20–25 MB (Gmail and Yahoo at 25 MB, Outlook at 20 MB). Modern iPhone photos typically range from 3 MB to 12 MB depending on mode, so a handful of attachments will hit the limit. The same problem appears everywhere: website uploads that reject large files, social media platforms that take forever to load your photos, cloud storage filling up faster than expected.

The solution is image compression — making files smaller without making them look worse. Here's what you actually need to know, explained without jargon.

Why Are My Photos So Large?
A digital photo is a grid of pixels, and each pixel stores color information. A single photo from a modern smartphone might be 4032 × 3024 pixels — that's over 12 million pixels. Each pixel needs at least 3 bytes (one for red, green, and blue), so the raw data is around 36 MB before any compression.

JPEG compression reduces this dramatically by discarding details that the human eye can't easily see. That 36 MB of raw data becomes a 3–6 MB JPEG. But even at 3 MB, a dozen photos will blow past most email limits.

What Compression Actually Does
Think of compression like summarizing a long document. A good summary preserves the key points while cutting the word count. Image compression does the same thing with visual information — it keeps the details that matter and simplifies or discards the ones that don't.

When you set a JPEG to "quality 80" (the default in CompactJPG), you're telling the compressor: "keep 80% of the visual information that matters most." The result is a file that looks almost identical to the original but is 40–70% smaller.

The Quality Sweet Spot
There's a quality sweet spot for most photos: somewhere between 70 and 85. Below 70, you start to notice artifacts — blocky patches, color banding, and blurry edges. Above 85, you're paying a steep file-size penalty for improvements that are nearly invisible.

Here's a rough guide:

Quality 85–95: For photos you plan to print or edit further. Minimal quality loss, but files are still relatively large.
Quality 70–85: The sweet spot for web, email, and social media. Files are 40–70% smaller than the original, and quality is excellent.
Quality 50–70: For thumbnails or where file size is the top priority. Noticeable quality loss on close inspection, but fine for small images.
Below 50: Only for extreme compression needs. Expect visible artifacts.
PNG vs JPEG: Which Should You Use?
The short answer: use JPEG for photos, PNG for graphics with text, logos, or screenshots.

JPEG was designed for photographs — images with smooth color gradients and lots of detail. It's excellent at compressing these while keeping quality high.

PNG was designed for images that need pixel-perfect clarity: logos with sharp edges, screenshots with text, or any image that needs transparency. PNG compression is lossless, meaning it never degrades quality, but it can't compress photos as efficiently as JPEG.

For web images, this matters a lot. A photo saved as PNG might be 5× larger than the same photo saved as a quality-80 JPEG, with no visible quality difference.

What About WebP?
WebP is a newer format developed by Google that aims to be better than both JPEG and PNG. At the same quality level, WebP files are typically 25–35% smaller than JPEG. It also supports transparency like PNG.

Today, all modern browsers support WebP, so it's a great choice for the web. CompactJPG can compress WebP images just like JPEG, using the same quality slider.

The Easiest Way to Compress Images
CompactJPG was built for exactly this use case. Here's how simple it is:

Drop your images on the page — or click to browse, or paste from clipboard.
Click Compress. That's it. The default quality (80) works for most images.
Compare the result using the side-by-side view if you want to check quality.
Download individual files or all at once as a ZIP.
And here's the important part: your images never leave your device. Everything happens in your browser using WebAssembly technology. No uploads, no servers, no privacy concerns. Just smaller images.

You can try the tool at https://compactjpg.com