Welcome
Web Image Formats Research
Section titled “Web Image Formats Research”Research project for determining optimal modern image formats for the web, with a focus on AVIF and comparative analysis against JPEG, WebP, and JPEG XL.
The project now supports both classic resolution-impact studies and crop-impact studies. Crop-impact studies keep the measured analysis fragment at full resolution while varying the surrounding image area, which avoids the metric and comparability problems introduced by downscaling.
- Identify optimal quality settings for AVIF encoding
- Determine when to use chroma subsampling based on quality targets
- Compare AVIF effectiveness against JPEG, WebP, and JPEG XL
- Analyze compression efficiency using perceptual quality metrics
- Measure how input area affects encoder behaviour without resampling confounds
Key Findings
Section titled “Key Findings”SSIMULACRA2 — AVIF and JPEG XL deliver comparable perceptual quality at significantly lower file sizes than WebP and JPEG:
Butteraugli — under this distortion model JPEG XL consistently edges ahead of AVIF, highlighting how metric choice affects codec rankings:
See the full interactive report for all studies and metrics.
Quick Start
Section titled “Quick Start”-
Open this repository in VS Code
-
Reopen in the dev container (VS Code will prompt)
-
Verify everything works:
Terminal window just verify-toolsjust check # Runs lint, typecheck, and tests
See the Getting Started tutorial for detailed setup instructions.
Project Structure
Section titled “Project Structure”├── src/ # Source code modules│ ├── study.py # Study configuration loading│ ├── dataset.py # Dataset fetching and management│ ├── preprocessing.py # Image preprocessing (resize, crop, convert)│ ├── encoder.py # Format encoding (JPEG, WebP, AVIF, JXL)│ ├── quality.py # Quality measurement (SSIMULACRA2, PSNR, SSIM, Butteraugli)│ ├── pipeline.py # Unified pipeline with time-budget control│ ├── analysis.py # Statistical analysis and static plotting│ ├── interactive.py # Interactive Plotly visualizations│ ├── comparison.py # Visual comparison image generation│ └── report_images.py # Responsive image optimization for reports├── scripts/ # CLI entry points for each workflow step├── config/ # Configuration files (datasets, studies)│ └── studies/ # Per-study JSON configurations├── data/ # All research data (git-ignored)│ ├── datasets/ # Raw image datasets│ ├── preprocessed/ # Preprocessed images (resized or cropped)│ ├── encoded/ # Encoded images (JPEG, WebP, AVIF, JXL)│ ├── metrics/ # Quality measurements (JSON)│ ├── analysis/ # Analysis outputs (CSV, SVG plots)│ └── report/ # Generated HTML reports├── docs/ # Documentation (Diátaxis framework)├── .devcontainer/ # Dev container configuration├── .github/workflows/ # CI pipeline├── pyproject.toml # Project configuration and dependencies└── justfile # Development task runnerDevelopment Commands
Section titled “Development Commands”# Developmentjust install-dev # Install all dependencies (dev + production)just check # Run all quality checks (lint + typecheck + test)just test # Run testsjust lint # Check code stylejust lint-fix # Fix auto-fixable lint issuesjust format # Format code and markdownjust typecheck # Run type checkingjust verify-tools # Verify encoding and measurement tools
# Study Workflowjust fetch <dataset-id> # Fetch a dataset (e.g., div2k-valid, liu4k-v1-valid)just pipeline <study-id> <time> # Run unified encode+measure pipeline (e.g., 30m, 1h)just analyze <study-id> # Analyze results and generate plotsjust compare <study-id> # Generate visual comparison imagesjust report # Generate interactive HTML report for all studiesjust serve-report [port] # Serve report locally (default: http://localhost:8000)
# Example crop-impact workflowjust pipeline avif-crop-impact 30mjust analyze avif-crop-impactjust compare avif-crop-impact
# Releasejust release-notes # Generate release notes from study resultsjust release-assets # Prepare release assets (zip + CSV files)
# Cleanupjust clean # Clean Python cache and build artifactsjust clean-study <study-id> # Remove all data for a specific studyjust clean-studies # Remove all study data (preserves datasets)
# Documentationjust docs-generate # Generate docs from source files and Python docstringsjust docs-install # Install documentation site dependenciesjust docs-dev # Start documentation dev server (http://localhost:4321)just docs-build # Build optimized documentation sitejust docs-preview # Preview built documentationDocumentation
Section titled “Documentation”This project follows the Diátaxis documentation framework:
- Tutorials — Step-by-step guides to get started
- How-to guides — Solutions for specific tasks
- Reference — Technical details and API descriptions
- Explanation — Background concepts and design decisions
Building Documentation
Section titled “Building Documentation”The documentation is generated using Astro Starlight for optimal performance:
# Generate and preview locallyjust docs-dev
# Build for productionjust docs-buildThe documentation includes automatically generated API reference from Python docstrings.
License
Section titled “License”See LICENSE.