NASA-IMPACT / veda-ui

Frontend for the Dashboard Evolution project
Other
18 stars 4 forks source link

Use WebP as the default image format? #336

Open nerik opened 1 year ago

nerik commented 1 year ago

I noticed it is suggested here to use png as the format for images. The analysis graph export image functionality export jpgs images. Should we switch to WebP, as it is the most performant file format being supported by all major browsers?

danielfdsilva commented 1 year ago

Good idea! @hanbyul-here I don't remember, was there a reason why the chart export was jpg?

nerik commented 1 year ago

@danielfdsilva Would it be useful to batch convert all images on delta-config to webp?

nerik commented 1 year ago

To my surprise, PNG can be almost as efficient as WebP in lossy mode (so using pngquant as suggested in the documentation). https://pngmini.com/vs-webp/ Probably not worth the trouble if existing images already went through pngquant

hanbyul-here commented 1 year ago

@danielfdsilva No not that strong reasong behind of jpeg. I was in between png and jpeg. I think the use case of the exported image is more like scientists using it for their presentation etc.(not really for browsers) so thought jpeg can be a more convenient format speaking of the size of the image without further processing etc. But I don't think it is much difference. I will vote for going with png than webp (for exporting) mainly because it is a more well-known image format for people.

@nerik for batch image processing: Yes~ I think it will be ideal if we can run the script automatically.. or even just a script that we can run from time to time will help. (just FYI Netlify offers image optimization option for assets but we don't use Netlify for production :{ )