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

推荐订阅源

GbyAI
GbyAI
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
V
V2EX
Cloudbric
Cloudbric
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
量子位
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
K
Kaspersky official blog
博客园 - 【当耐特】
T
Tenable Blog
L
Lohrmann on Cybersecurity
The Cloudflare Blog
S
Schneier on Security
A
Arctic Wolf
Latest news
Latest news
C
Cyber Attacks, Cyber Crime and Cyber Security
罗磊的独立博客
T
The Exploit Database - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
雷峰网
雷峰网
NISL@THU
NISL@THU
人人都是产品经理
人人都是产品经理
月光博客
月光博客
J
Java Code Geeks
V
Visual Studio Blog
S
Security Affairs
博客园 - Franky
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
H
Heimdal Security Blog
有赞技术团队
有赞技术团队
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
T
Troy Hunt's Blog
SecWiki News
SecWiki News
Spread Privacy
Spread Privacy
宝玉的分享
宝玉的分享
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 聂微东

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Every JPEG Is a Model of Your Retina
Arthur · 2026-05-15 · via DEV Community

There is, sitting on every disk and every phone and every web server in the world, a thirty-year-old standard that contains, layer by careful layer, an engineering description of how the human visual system works. The standard is JPEG. The description is mostly invisible because the engineers who wrote it did their work in 1992 and then everybody else moved on to writing CRUD apps. The interesting fact about JPEG is not that it compresses images. The interesting fact about JPEG is that it does it by quietly running a model of the user's eye.

I want to take that observation seriously rather than file it under "history of imaging." The thirty years between the JPEG specification's CCITT approval on 18 September 1992 and the present moment have produced WebP, AVIF, JPEG XL, and a long tail of also-rans, every one of which is a refinement of the same trick. The trick is biology. The codecs are getting better at doing what JPEG did first, which is to say, they are getting better at modelling the user. There is something worth saying about an industry whose dominant image format is, by design, a working theory of perception that almost nobody outside imaging research thinks of as such.

What JPEG does first

When a JPEG encoder receives an image, the very first thing it does is throw away the colour space the image arrived in. RGB is how cameras capture light and how monitors emit it. JPEG converts to a different space called YCbCr, defined for video and digital still imaging by ITU-R Recommendation BT.601, in which Y is luminance — how light or dark a pixel is — and Cb and Cr encode the colour as two difference channels: blue minus luminance, red minus luminance.

The conversion formula is the part that gives the game away. The luminance channel is calculated as Y = 0.299 × R + 0.587 × G + 0.114 × B. Three coefficients, summing to one, weighted heavily towards green and only lightly towards blue. The coefficients are not arbitrary. They track the photopic luminosity function of the human eye, which peaks around 555 nanometres in the yellow-green region of the spectrum, the same wavelengths a primate retina is most efficient at distinguishing. Evolution shaped that curve to help an arboreal ancestor pick ripe fruit out of foliage. The 1992 standards committee copied it.

There is a second reason for the conversion. The retina itself is asymmetric. The human eye contains roughly 120 million rod cells, which carry luminance information, and roughly six million cone cells, which carry colour — a twenty-to-one ratio of light-sensitive hardware to colour-sensitive hardware. RGB treats the three channels as equally important. The retina does not. The very first thing JPEG does is split the signal along the same line your eye splits it.

Throwing away seventy-five percent of the colour

After the conversion, the encoder has the option to store the colour channels at lower resolution than the luminance channel. The default mode for most encoders is called 4:2:0 chroma subsampling, in which each two-by-two block of luminance pixels shares a single colour pixel. Three quarters of the colour information, by storage volume, is discarded.

Almost nobody notices. The reason is that the cone cells are not distributed evenly across the retina but concentrated in a small central region called the fovea, which subtends about two degrees of the visual field. Outside the fovea, peripheral colour vision is dramatically worse than peripheral luminance vision. The visual system has, in effect, been doing 4:2:0 subsampling on its own input for the entire history of vertebrate vision. JPEG is not throwing away the colour data the user sees. It is throwing away the colour data the user's retina did not sample in the first place.

A reproducible experiment, easy enough to perform in any image editor that supports the YCbCr colour model: take a sharp photograph, split it into Y, Cb, and Cr channels, and view each in isolation. The luminance channel looks like a clean black-and-white version of the image. The two colour channels look like blurry, low-contrast smudges. The user's first reaction is usually that the photo "could not really have been like that." It was, in fact, exactly like that. The visual system was assembling the appearance of a sharp colour image from a sharp luminance signal and two soft colour signals all along.

The discrete cosine transform and the visual cortex

The compression part of JPEG, the part most engineers can name without looking it up, divides the image into eight-by-eight blocks and applies a discrete cosine transform to each block. The DCT decomposes the block into sixty-four spatial-frequency components, ranging from a smooth gradient (the lowest frequency) to fine alternations of light and dark (the highest). The mathematics of the DCT was introduced in a 1974 paper by Ahmed, Natarajan, and Rao. The reason JPEG uses it is older than the maths.

In 1959, David Hubel and Torsten Wiesel inserted a microelectrode into the primary visual cortex of an anaesthetised cat and projected various patterns onto a screen in front of the animal. They were trying to understand how V1 neurons responded to visual stimulation. They discovered that individual neurons in the primary visual cortex, the structures they later called simple cells, fired most strongly in response to oriented bars and edges at specific spatial frequencies. Different cells preferred different orientations. Different cells preferred different frequencies. The cortex, they argued, was performing a localised decomposition of the incoming image into something resembling a Fourier basis. The work earned Hubel and Wiesel the 1981 Nobel Prize in Physiology or Medicine, shared with Roger Sperry.

The DCT is not the same operation as the one V1 simple cells perform. It is, however, the closest computationally cheap approximation that fit on the hardware available in 1992. The JPEG committee did not have the model of V1 we have now. They had the psychophysics of spatial-frequency perception, fifty years of contrast-sensitivity experiments, and the practical observation that an eight-by-eight block of frequencies behaved, when reassembled, like a unit of perception. The choice of basis was, structurally, a guess at what the visual cortex was doing. It was a good guess.

The quantization table is your contrast sensitivity function

After the DCT, JPEG has sixty-four coefficients per block. To compress, the encoder divides each coefficient by an entry from a quantization table and rounds the result. Coefficients corresponding to perceptually important frequencies are divided by small numbers and survive almost intact. Coefficients corresponding to frequencies the eye barely resolves are divided by large numbers and round to zero.

The standard luminance quantization table that ships with most JPEG encoders is shaped, when laid out as an eight-by-eight grid, like a low-pass filter. The top-left corner — DC and the lowest frequencies — has small entries. The bottom-right corner — the highest frequencies — has the largest. The shape of that filter mirrors the human contrast sensitivity function, which peaks somewhere between three and six cycles per degree of visual angle, falls off steadily below one cycle per degree, and falls off rapidly above roughly sixty cycles per degree — the upper limit of human spatial resolution. The numbers in the table were established by psychovisual experiments on real people, not derived from first principles. They are an engineering reading of the species' visual response curve.

The quality slider, which most users have moved at some point without thinking about it, multiplies the entries in the quantization table by a scaling factor. Higher quality means smaller divisors and finer preservation of high-frequency detail. Lower quality means larger divisors and more aggressive zeroing of frequencies the user is unlikely to see. There is a soft cliff in the curve, sometimes placed somewhere around quality 75 or 80, where the algorithm crosses from "throwing away frequencies you cannot see" into "throwing away frequencies you can." Below the cliff the artifacts become visible, and the visibility is itself a measurement of the contrast sensitivity function. The cliff is the boundary of human spatial vision, mapped in JPEG units.

Annex K and the thirty-year refinement

A widely-noted footnote in the JPEG specification is that Annex K, which contains the example quantization tables, presents them as illustrative rather than as defaults. Every encoder is permitted to substitute its own. MozJPEG takes that permission seriously and computes per-image quantization tables, spending CPU at encode time to fit the perceptual model more tightly to the specific photograph. The quality at a given file size is measurably better. The compression target has not moved. The model of the user has been sharpened.

The successor formats follow the same pattern. WebP and AVIF use better entropy coders, support more colour primaries, and produce smaller files at equivalent perceptual quality, but their compression rationale is the same one JPEG had: throw away the parts of the signal the visual system never resolves. AVIF goes further with a feature called film grain synthesis, which decodes film-style noise from a small parameter set on the receiver instead of storing the noise pixel by pixel. The justification is biology. The brain does not record the specific positions of grain particles in a photograph; it records their character. AVIF stores the character.

JPEG XL, finalised in 2022, goes furthest. Its compression engine includes Butteraugli, a perceptual difference metric Google built to model the human visual system, which scores potential reconstructions on a per-block basis against the original and chooses the one whose difference is least visible to a simulated human observer. The codec is, more or less explicitly, running a model of vision for every block it encodes. Chrome added JPEG XL support behind a flag in 2021 and then removed it in 2023, citing insufficient ecosystem traction — a quiet, sad story that is not the subject of this essay but is part of the long tail in which compression formats live and die on platform politics rather than perceptual merit.

The thirty years between the JPEG committee and Butteraugli have not changed the engineering target. They have refined the model of vision the codec uses to hit it.

What the codec is actually saying

Every time a JPEG encoder runs, it is making a series of explicit statements about how the user's visual system is structured. It states that luminance matters more than colour, by a factor of about four. It states that colour resolution drops off quickly outside the fovea, so colour can be subsampled. It states that the cortex decomposes images into spatial frequencies, so frequency-domain coding is the right substrate. It states that the user is more sensitive to mid-frequency variation than to either very low or very high frequencies, so the quantization table can be unevenly graded. Every one of these statements is a falsifiable claim about the user's biology, and every one of them was experimentally verified before being soldered into the standard.

The standard does not feel like a falsifiable claim about biology, because it is a small dialog box in an image editor that has the word "quality" next to a slider. That is the camouflage. The claim is that the user's eyes are a particular kind of imperfect, and the algorithm exploits that imperfection in a particular kind of way. The claim has held up well enough that thirty years of better hardware and better mathematics have produced refinements rather than replacements.

What the trick was always about

JPEG is not an image-compression algorithm. It is a perception-compression algorithm. The interesting question about it is not how the maths works; the maths is well-described in textbooks and rarely revisited. The interesting question is why the 1992 specification got the model of vision right enough that nothing has displaced it. The successor formats are sharper instruments cutting along the same line. The line was drawn correctly the first time.

Every time a photograph is saved at quality eighty and uploaded to a web page that millions of strangers will scroll past, a small piece of software is making, in effect, a public statement about how those strangers' eyes work. The statement is right. The strangers do not notice the seams in the picture, because the seams have been placed where their visual systems were never going to look. There is something quietly remarkable about an industry whose most ubiquitous file format is, in its bones, a careful and accurate description of the people who use it.