if “Load WebP or AVIF in supported browsers?” is on, .png
files with transparency will loose that transparency in browsers that support AVIF due to a recent technical change in Shortpixel’s AVIF toolchain.
Shortpixel is looking at alternative solutions, but until then as a workaround you can either:
- add
.png
to Autoptimize’s lazyload exclusion field - or to use below code snippet to disable AVIF images;
add_filter( 'autoptimize_filter_imgopt_do_avif', '__return_false');
Follow-up; Shortpixel has for now disabled png -> avif conversion (redirecting back to the original png-file) until a better, cross-browser solution for transparency can be found.