ProgressiveImageLoader needs more than one copy of your image — it needs a sequence of copies at different quality levels, ordered from worst to best. The loader displays the lowest-quality version almost instantly (because it is a tiny file), then transparently upgrades the display as each higher-quality version finishes downloading. Preparing this sequence correctly is the single most important step before writing any JavaScript.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/1TSnakers/ProgressiveImageLoader/llms.txt
Use this file to discover all available pages before exploring further.
What you need
A valid image sequence is simply an array of paths pointing to the same subject rendered at increasing quality levels:| Array position | Quality level | Role |
|---|---|---|
images[0] | Most degraded (smallest file) | Shown immediately while others load |
images[1..n-2] | Intermediate levels | Progressive upgrades |
images[n-1] | Full quality (largest file) | Final display state |
Option A — Create image variants manually
You can produce the sequence with any image editor (Photoshop, GIMP, Squoosh, etc.). The technique is flexible: you might export the same source image at multiple JPEG quality settings, resize it to progressively larger pixel dimensions, or combine both approaches. A practical three-step manual workflow:- Thumbnail — resize to ~10 % of the original pixel dimensions and save as a heavily compressed file (e.g. 5–15 KB).
- Mid-quality — resize to ~50 % of the original dimensions or export at medium compression quality (e.g. 50–100 KB).
- Full quality — the original or lightly compressed source file.
["thumbnail.png", "mid.png", "full.png"] to the images option.
Option B — Use the bundled image_ruiner.py script
The repository ships a Python helper script at images/image_ruiner.py that automates the entire sequence-generation workflow. It uses Pillow to create multiple downscaled versions of a source image, optionally stamps each frame with a quality-reduction label, and writes an image_list.js module you can import directly into your HTML.
Function signature
steps + 1 files (0 % through 100 % degradation) and reverses the list before writing image_list.js, so the exported array already runs from most-degraded to least-degraded — the exact order ProgressiveImageLoader expects.
Step-by-step workflow
Install Pillow
The script requires the Pillow imaging library. Install it into your Python environment:
Place your source image in the images/ directory
Copy your full-quality source image into the If you use a different filename, update the
images/ folder alongside image_ruiner.py. The default entry point in the script expects a file named sample.png:image_path argument in the __main__ block at the bottom of the script, or call the function directly with your filename.Run the script
Execute the script from inside the Using the default settings, this call is equivalent to:
images/ directory:Inspect the output
After the script completes you will find two new outputs:
images/pixel_degraded_pngs/ — a directory containing 9 PNG files (for the default steps=8):images/image_list.js — a JavaScript module with a pre-ordered array:Understanding the naming convention
The numeric suffix in each filename represents the percentage of quality reduction applied to the original image, not a quality score:degraded_000.png
0 % quality reduction — identical to the source image. This is the full-quality version and always goes last in the
images array.degraded_100.png
100 % quality reduction — the most aggressively downscaled version. This tiny file loads fastest and always goes first in the
images array.The script achieves degradation by resizing the image down using nearest-neighbour interpolation (
Image.NEAREST), which produces a pixelated, blocky appearance rather than a blurry one. At 100 % reduction the image is scaled to just 10 % of its original pixel dimensions. There is no JPEG re-compression involved — all outputs are PNGs.Correct array ordering — a reminder
Regardless of whether you prepare images manually or with the script, theimages array passed to ProgressiveImageLoader must always run from least quality to most quality: