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
- Host: GitHub
- URL: https://github.com/marketingpipeline/image-optimizer-action
- Owner: MarketingPipeline
- License: mit
- Created: 2022-07-11T10:34:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-11T05:13:39.000Z (almost 4 years ago)
- Last Synced: 2023-03-05T04:58:08.457Z (over 3 years ago)
- Topics: 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
- Language: Shell
- Homepage:
- Size: 33.2 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image-Optimizer-Action
## 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 
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 
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.