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.23k stars 270 forks source link
azure azure-functions bot code-quality compress-images dotnet-core github-app github-integration help-wanted image-compression image-optimization imagemagick optimize-images

Imgbot

Imgbot crawls all your image files in GitHub and submits pull requests after applying a loss less compression. This will make the file size go down, but leave the dimensions and quality just as good.

screenshot

Configuration

Imgbot supports optional configuration through a .imgbotconfig json file. This is not a required step to using Imgbot and is only for more advanced scenarios. This file should be placed in the root of the repository and set to your liking.

{
    "schedule": "daily", // daily|weekly|monthly
    "ignoredFiles": [
        "*.jpg",                   // by extension
        "image1.png",              // by filename
        "public/special_images/*", // by folderpath
    ],
    "aggressiveCompression": "true", // true|false
    "compressWiki": "true", // true|false
    "minKBReduced": 500 // set reduction threshold (default to 10),
    "prTitle" : "Compressed images", // set pull request title
    // set the pull request body, supports any valid github markdown
    // {optimization_ratio} display a message containing the optimization ratio
    // {optimization_details} display the table containing the optimization details
    "prBody" : " Text before optimization ratio {optimization_ratio} Text after optimization ratio 
                Text before optimization details {optimization_details} Text after optimization details",

}

The following are the currently supported parameters. If there are any configuration settings you would like to see changed or supported, please feel free to open an issue here in the repo or shoot an email over to help@imgbot.net

schedule

ignoredFiles

aggressiveCompression

compressWiki

minKBReduced

prTitle

prBody

Find out more: https://imgbot.net/docs

Contributing

All the code for Imgbot is available on GitHub. We will gladly accept contributions for the service, the website, and the documentation. This is where you can find out how to get set up to run locally as well as detailed information on exactly how Imgbot works.

https://imgbot.net/docs#contributing