What does it do?
You can analyze a build output folder, a single HTML file, or a running URL. ViewFit measures the display size of images and CSS background images in Chromium and accounts for the device pixel ratio. When given a folder, it recursively examines HTML pages and processes images used on multiple pages once, based on the largest observed display size. It reports remote images that cannot be linked to local files but does not modify them.
Key features
- Measures the actual display size of images and CSS background images in Chromium.
- Suggests a target size for each image based on the device pixel ratio.
- Resizes and compresses each image file with Sharp.
- Recursively analyzes HTML pages in a folder.
- Processes images used on multiple pages once, based on their largest display size.
- Reports remote and CDN images without modifying them.