Design & Media
Preparing Web Images, QR Codes, and Alt Text Audits in the Browser
Reduce image byte weight with HTMLCanvasElement, choose resilient QR code error correction, and audit missing alt attributes directly in the browser.
Media delivery
Resize dimensions, verify QR contrast, audit alt text
Compress images via Canvas, protect QR quiet zones, and catch missing WCAG 1.1.1 attributes.
Inputs
raster photos, QR URLs, or DOM images
Rule
dimension scaling, contrast, and text alternatives
Check
LCP weight, phone scan, and screen-reader labels
Delivering clean web media takes three checks before publish: shrink decoded image dimensions and byte weight using the Image Compressor, verify scannable contrast and quiet zones for generated codes in the QR Code Generator, and inspect deployed <img> tags for missing or broken attributes with AltCatch. Every asset step processes files locally in your browser within the design tools hub without uploading source artwork to Toolk servers.
Treating compression, QR encoding, and accessibility metadata as one workflow keeps Largest Contentful Paint fast while preventing broken previews and unreadable graphics.
Quick answer: browser media checks before shipping
| Media task | Matching tool | What to verify |
|---|---|---|
| Shrink JPEG/PNG/WebP byte size | Image Compressor | Pixel dimensions, visual artifacts, and output format |
| Generate scannable QR assets | QR Code Generator | Dark foreground on light background plus quiet margin |
| Audit missing alt text and 404 images | AltCatch | Every <img> has purposeful alt or alt="" if decorative |
| Inline tiny icons or vector badges | Image to Base64 | File overhead vs saved HTTP request (keep under a few KB) |
Image compression tradeoffs in the browser
Large hero photographs and unresized camera exports are among the most common drags on Largest Contentful Paint (LCP). Browser-based compressors use HTMLCanvasElement.toBlob() to re-encode pixels at a chosen dimension and quality setting:
- Resize dimensions first: Scaling a 4000-pixel photo down to the maximum container width (for example,
1200pxor1600px) cuts pixel count by 75–90% before quality sliders even apply. - Avoid re-compressing lossy JPEGs repeatedly: Always compress from the highest-quality original available to prevent compounding compression ringing.
- Know browser limits: Canvas re-encoding strips original EXIF metadata cleanly and depends on the browser's built-in JPEG, PNG, and WebP encoders. Note that browser
toBlob()typically lacks specialized server encoders like AVIF or multi-pass MozJPEG tuning, so compare visual detail beside the compressed byte count.
For sizing social link images alongside compression, read the Open Graph and meta tags guide, check icon dimensions and aspect locking in our favicon sizes and aspect ratios guide, and use the Base64 encoding guide before inlining data URIs.
QR code readability and error correction
QR symbols remain reliable only when physical print size, scanner distance, and visual contrast align:
- Keep a four-module quiet zone: Never crop all white margin off the edges; scanners rely on clean light border space to lock onto the three corner finder patterns.
- Maintain strong foreground/background contrast: Dark modules over a clean light background scan far more reliably than inverted white-on-dark codes in bright glare.
- Choose shorter URLs when possible: Shorter payloads create coarser grids that stay scannable at smaller print sizes. Always test printed or displayed codes from a real phone camera before mass distribution.
Accessibility checks with AltCatch
Compressed images still fail users if their alternative text is omitted or auto-filled with "image123.jpg". Per WCAG 2.2 Text Alternatives (1.1.1):
- Informative images need concise
altcopy explaining the purpose the image serves in context. - Purely decorative illustrations take an empty attribute (
alt="") so screen readers skip them cleanly. - Functional icons inside links or buttons should describe the action destination rather than the icon's literal appearance.
Run AltCatch inside Chrome to group missing alt attributes, placeholder text, and broken 404 <img> URLs into a reviewable Markdown checklist. All image bytes stay on your device during compression and QR generation, while page-view analytics remain separate from local file handling.
Browse additional color, layout, and icon utilities in the design tools directory.
Primary references
Keep reading
Related posts
px vs em vs rem in CSS: Sizing Rules and Examples
Compare CSS pixels, element-relative em, and root-relative rem. Understand nested sizing, font preferences, browser zoom, and conversion assumptions.
Read postMetric and Imperial Unit Conversions: Exact Factors and Offsets
Reference exact 1959 yard-pound conversion factors, affine Celsius-Fahrenheit-Kelvin formulas, US vs imperial volume units, and rounding rules.
Read postPercentage Change, Percentage Points, and Reverse Percent Math
Compare percent of a number, percentage change, reverse tax extraction, and percentage points with exact formulas, examples, and zero-base limits.
Read post