Compress an AVIF hero without guessing at visual quality
A practical AVIF workflow starts with one representative hero, a careful visual check and a separate test for mobile loading.
Compare editor exports, local command-line workflows and browser batches, then verify transparency and measure the change in your app build.
UI icon sets are small enough to overlook and numerous enough to add up. Compressing them in bulk can reduce the weight of assets shipped with a mobile app, but a smaller file is not a good trade if an icon gains a fringe, loses a fine detail or looks different against the app’s backgrounds.
There are three practical routes: export or optimize files one at a time in an image editor, use a local command-line process, or upload a batch to a browser compressor. None is best for every team. The right choice depends on how often the work happens, how much control the task needs and whether the files can leave the development machine.
Before compressing, make a copy of the icon directory or work on a branch. Keep the originals until the app has been checked. Group assets by role or visual style rather than sending an entire repository at once; a compact test batch makes it easier to spot a problem and trace it to a file.
Choose representative icons that expose likely trouble: thin strokes, small details, soft shadows, rounded corners and edges that meet both light and dark backgrounds. Compress a few first. Compare each output with its source at the size used in the interface, not only enlarged in an image viewer. Check transparent edges against contrasting backgrounds for halos or unwanted solid pixels. Also check that the output remains transparent and that the icon’s dimensions have not changed.
PNG output by itself is not a guarantee that every boundary looks identical. Keep the comparison visual and specific to the assets your app uses. If the result is questionable, keep the original rather than accepting a byte reduction at the cost of a visible defect.
Opening files in an editor and exporting them one at a time gives a person direct oversight. That can suit a handful of high-visibility icons, or cases where an artist needs to make a deliberate visual adjustment alongside compression. It is also straightforward to inspect an individual result.
The trade-off is repetition. For a large set, the handling time grows, and different export choices can make results less consistent. This route is less attractive for routine cleanup across hundreds of assets unless the team already has a controlled export process.
A local command-line workflow can suit teams that compress assets regularly and want the step to fit into their existing scripts or build process. It avoids uploading files to a browser service, but the team must choose, configure and maintain its own tooling. It also needs safeguards: process copies or use a recoverable change, and review the outputs before they become the new source assets.
PiPic offers an open-source CLI published as @pipic/cli on npm. Its CLI tier allows 100 images per month, with a Pro plan for 5,000 images per month. That makes it worth evaluating for recurring command-line work, but teams should compare those quotas with their actual volume and confirm that the workflow fits their review and replacement practices. For a broader browser-versus-command-line decision, see how the workflow changes the choice between web and CLI compression.
A browser compressor avoids installing a local tool and can be convenient for a one-off cleanup. PiPic’s browser version accepts JPG, PNG, WebP and AVIF files up to 8 MB each, with batches of up to 100 images. It is free without registration or watermarks. PiPic says files are deleted from its servers immediately after compression.
That limit makes it suitable for a bounded icon set that fits the batch and file-size caps. Split larger collections into manageable groups and keep a clear mapping between inputs and outputs. Because this route uploads files, teams should also consider whether their asset-handling rules allow that. A short review of retention practices around image handoffs can help frame that decision.
After the test passes, process the remaining files in batches. Compare the source and output names, dimensions and file sizes. Review icons on the backgrounds and at the display sizes used in the mobile interface; include any scaled or tinted variants that matter to the design. Keep an eye on alpha boundaries where a transparent edge meets a contrasting surface.
Finally, build the app and measure the packaged assets rather than assuming that individual file savings translate directly into a smaller deliverable. Check the app’s appearance on a representative screen, then retain the original files or a reversible change until the review is complete. For a dozen carefully chosen icons, manual export may be the least work. For repeated sets, a local process may be easier to standardize. For occasional batches within its limits, a browser compressor can cut setup. The useful result is not merely a smaller PNG; it is a smaller asset set that still renders cleanly in the interface.
A practical AVIF workflow starts with one representative hero, a careful visual check and a separate test for mobile loading.
Keep regional assets organized while reducing image weight, with PiPic for compression and your own staging and review steps for path safety.
CLI quotas, per-batch caps and API limits measure different things. Plan around the unit each tool actually counts before putting compression in CI.