pre-commit-images
Scripts for image optimization usable as pre-commit hooks
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Scripts for image optimization usable as pre-commit hooks
Basic Info
Statistics
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 33
Topics
Metadata Files
README.md
Scripts that can work as git hooks to optimize and manipulate images.
These scripts can be called directly or with the provided configuration for the pre-commit framework.
For details see below.
Using pre-commit-images with pre-commit
Add this to your .pre-commit-config.yaml:
- repo: https://github.com/boidolr/pre-commit-images
rev: v1.9.0 # Use the ref you want to point at
hooks:
- id: optimize-png
# - id: ...
For an extended example see .pre-commit-config.yaml.
Available hooks
optimize-avif: Compressavifimages.--thresholdcan be used to configure which size difference should be used to keep the image.--qualityto configure minimum quality setting (best: 100, worst: 0).--effortto set the quality/speed tradeoff (slowest: 0, fastest: 10).
optimize-jpg: Compressjpegimages.--thresholdcan be used to configure which size difference should be used to keep the image.--qualitycan be used to configure quality setting for a JPG image.
optimize-png: Compresspngimages.--thresholdcan be used to configure which size difference should be used to keep the image.
optimize-svg: Compresssvgimages.--thresholdcan be used to configure which size difference should be used to keep the image.
optimize-webp: Compresswebpimages.--thresholdcan be used to configure which size difference should be used to keep the image.--losslessswitch to lossless compression.--qualitycan be used to configure quality setting for lossy compression or effort to spend on lossless compression.
resize(experimental): Resizeavif,jpeg,pngandwebpimages with fixed dimensions. Required options:--widthnew width of images.--heightnew height of images.
Using scripts directly
Install the package to get access to the scripts defined as command line entry points in pyproject.toml.
The scripts accept the arguments given for the pre-commit hooks.
Additionally they exepect to receive the file names to work on.
An example invocation could be uvx --from 'git+https://github.com/boidolr/pre-commit-images.git' optimize-avif tests/test.avif.
Available entry points are identical to the pre-commit hooks:
- optimize-avif
- optimize-jpg
- optimize-png
- optimize-svg
- optimize-webp
- resize
References
These hooks only work because of other projects:
Owner
- Name: Raphael Boidol
- Login: boidolr
- Kind: user
- Location: Munich, Germany
- Company: @TNG
- Website: https://boidolr.github.io/
- Repositories: 12
- Profile: https://github.com/boidolr
coding for the fun of it
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Boidol" given-names: "Raphael" title: "pre-commit-images" abstract: >- pre-commit-images will optimize images for size before they are checked in. license: MIT license-url: "https://github.com/boidolr/pre-commit-images/blob/main/LICENSE" repository-code: "https://github.com/boidolr/pre-commit-images" url: "https://github.com/boidolr/pre-commit-images"
GitHub Events
Total
- Create event: 82
- Issues event: 1
- Release event: 6
- Watch event: 3
- Delete event: 74
- Issue comment event: 8
- Push event: 108
- Pull request review event: 2
- Pull request event: 146
Last Year
- Create event: 82
- Issues event: 1
- Release event: 6
- Watch event: 3
- Delete event: 74
- Issue comment event: 8
- Push event: 108
- Pull request review event: 2
- Pull request event: 146
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| renovate[bot] | 2****] | 191 |
| Raphael Boidol | b****r | 128 |
| github-actions | 4****] | 56 |
| github-actions | g****s@g****m | 17 |
| Renovate Bot | b****t@r****m | 8 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 2
- Total pull requests: 147
- Average time to close issues: N/A
- Average time to close pull requests: about 15 hours
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.07
- Merged pull requests: 140
- Bot issues: 1
- Bot pull requests: 115
Past Year
- Issues: 2
- Pull requests: 134
- Average time to close issues: N/A
- Average time to close pull requests: about 5 hours
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.07
- Merged pull requests: 129
- Bot issues: 1
- Bot pull requests: 106
Top Authors
Issue Authors
- renovate[bot] (1)
- DIMFLIX-OFFICIAL (1)
- shivan-s (1)
Pull Request Authors
- renovate[bot] (228)
- boidolr (55)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3 composite
- boidolr/actions/python-pip-env main composite
- boidolr/actions/run-precommit main composite
- boidolr/actions/create-release main composite
- actions/checkout v3 composite
- boidolr/actions/git-push main composite
- boidolr/actions/run-precommit main composite