Hoverbear / hoverbear.org

Sources for hoverbear.org
http://hoverbear.org/
3 stars 2 forks source link

Images is really large, and slow to load #14

Closed DCjanus closed 2 years ago

DCjanus commented 2 years ago

Hi, Thanks for your posts, which is really nice. I'm working for a Chinese company to optimize their network traffic cost in image, so I noticed that banner in each post is really large.

Like this pic: https://hoverbear.org/processed_images/c1bc11c7b5eb070f00.png

It cost 11MB in network, and if convert it to WebP with imagemagick, it would be 118KB, in AVIF, it's only 38K.

How about quality?In my official job, we compare images with PSNR:

action size PSNR
PNG -> WebP 11MB -> 118KB 42.7807
PNG -> AVIF 11MB -> 38KB 42.1162

PS: usually, we believe that human would not be able to detect difference if PSNR great than 40.

refs:

图片

Hoverbear commented 2 years ago

Thanks for highlighting this! I have responsive images set up but you're right, I could probably do some optimizing.

Hoverbear commented 2 years ago

I did an image optimization pass using a script I committed in https://github.com/Hoverbear/hoverbear.org/commit/79c28d5a3d6f1bfddd7af01630d53938cf4858e7