An open API service indexing awesome lists of open source software.

https://github.com/marketingpipeline/image-optimizer-action

A Github Action to optimize / compress images in your repository
https://github.com/marketingpipeline/image-optimizer-action

actions compress-image compress-images github github-action github-actions github-workflows image-compression image-compressor image-optimizer image-processing optimize-images photo-compression workflows

Last synced: 12 months ago
JSON representation

A Github Action to optimize / compress images in your repository

Awesome Lists containing this project

README

          

# Image-Optimizer-Action





A Github Action to optimize to optimize / compress images




Show your support!









## Example and usage

View Example Of Image Compression Results


✅ [OPTIMIZED] ./image_1.png
PNG/RGBA: 516.6 KB -> PNG/RGBA: 490.8 KB 🔻 5.0%
✅ [OPTIMIZED] ./image_2.png
PNG/RGBA: 771.8 KB -> PNG/RGBA: 741.5 KB 🔻 3.9%
✅ [OPTIMIZED] ./image_3.png
PNG/RGBA: 737.3 KB -> PNG/RGBA: 707.8 KB 🔻 4.0%
✅ [OPTIMIZED] ./image_4.png
PNG/RGBA: 31.4 KB -> PNG/RGBA: 30.7 KB 🔻 2.3%
✅ [OPTIMIZED] ./image_5.png
PNG/RGBA: 203.9 KB -> PNG/RGBA: 200.0 KB 🔻 1.9%
✅ [OPTIMIZED] ./image_6.png
PNG/RGBA: 534.2 KB -> PNG/RGBA: 514.5 KB 🔻 3.7%
----------------------------------------
Processed 6 files (2.7 MB) in 4.3s (1.4 f/s).
Optimized 6 files.
Average savings: 18.3 KB per optimized file
Total space saved: 109.9 KB / 3.9%

How to use this action


Note: By DEFAULT all supported image file types in the root of your repo excluding sub-folders will be optimized. (SVG images are NOT supported)



To optimize a single image file:


- uses: MarketingPipeline/Image-Optimizer-Action@latest
with:
filename: filename.jpg




To optimize all image files in a directory and all of its subdirectories:


- uses: MarketingPipeline/Image-Optimizer-Action@latest
with:
filename: /example_folder_path/
recursion: true



To optimize all image files in a directory, without recursion:


- uses: MarketingPipeline/Image-Optimizer-Action@latest
with:
filename: /example_folder_path/



Workflow Example(s)



View Example Workflow Usage


- uses: actions/checkout@v2
- uses: MarketingPipeline/Image-Optimizer-Action@latest

- name: Commit and Push Optimized Images
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Added Optimized Images"
git push


Example [workflow file](.github/workflows/example_workflow.yaml)



## Contributing ![GitHub](https://img.shields.io/github/contributors/MarketingPipeline/Image-Optimizer-Action)

Want to imrpove this action? Create a pull request with described in detail with your changes! If approved you will be added to the list of contributors of this awesome project!

See also the list of
[contributors](https://github.com/MarketingPipeline/Image-Optimizer-Action/graphs/contributors) who
participate in this project.

## License ![GitHub](https://img.shields.io/github/license/MarketingPipeline/Image-Optimizer-Action)

This project is licensed under the MIT License - see the
[LICENSE.md](https://github.com/MarketingPipeline/Image-Optimizer-Action/blob/main/LICENSE) file for
details.