imgbot / Imgbot

An Azure Function solution to crawl through all of your image files in GitHub and losslessly compress them. This will make the file size go down, but leave the dimensions and quality untouched. Once it's done, ImgBot will open a pull request for you to review and merge. help@imgbot.net
https://imgbot.net/
MIT License
1.24k stars 272 forks source link

Feature Request: Support conversion to webp format #1049

Open aditya-leap opened 2 years ago

aditya-leap commented 2 years ago

Request for new feature: Please enable conversion to WebP format for images, such that all uploaded images (jpg,png) are automatically converted to WebP format

GrigoreMihai commented 2 years ago

This is a really good suggestion, I think this will be implemented as another setting in .imgbotconfig would you also find it useful as a global toggle here: https://imgbot.net so it will apply to all repositories ?

MichaIng commented 2 years ago

I'd like it as global toggle as well, respectively IMHO it makes sense to have it globally enabled OOTB as there is no reason to handle webp any different than JPEG or PNG. But this is more a minor convenience question: Having support at all, via .imgbotconfig or any other way, would be great 🙂.

EDIT: Globally enabled by default was meant for webp optimisation, but conversion shouldn't be enabled by default of course.

LukasGutenberg commented 2 years ago

Hello, me and a lab partner are looking to implement this feature as part of a course in devops at KTH. Any tips before we start?

DaveSkender commented 2 years ago

Here’s some basic info on webp: https://developers.google.com/speed/webp

LukasGutenberg commented 2 years ago

Thanks, you can expect a PR sometime next week or early the following one.

Autonymic commented 2 years ago

We have problems running it locally on our computers. Line 16 in CompressImagesFunction.csproj

<Copy SourceFiles="@(NativeBinary)" DestinationFiles="@(NativeBinary->'$(TargetDir)bin/%(Filename)%(Extension)')" />

We get errors that claim it can't copy those files as they cannot be found. Do we have to download these or how do we resolve this?

EDIT: For running it on a local machine those lines aren't needed so we removed them to get it running. It's just we have difficulties testing the functions as the documentation for how to run things is lacking.

EDIT2: We have decided to drop this, as we've run out of time. If anyone else is willing to tackle this issue, go ahead.