Unmaintained: I've switched to using Czkawka.
This is a collection of hacky scripts tools for images, intended for my personal use.
Currently this consists of:
- hash: Compute the difference hash (d-hash) of an image.
- diff: Compare two images using SSIM.
- rmdup: Delete all duplicate images in a directory.
All tools are collected inside one module called imgtools
.
This uses argparse to parse commandline arguments, and sub-parsers for each tool.
To run a tool mytool, type:
imgtools mytool [args]...
For viewing the usage for a tools mytool, type:
imgtools mytool --help
For viewing the usage for the module itself, type:
imgtools --help
Poetry is used for conveniently installing and managing dependencies.
-
[Optional] Create and activate a virtual environment with Python >= 3.9.
-
Install Poetry globally (recommended), or in a virtual environment. Please refer to Poetry's installation guide for recommended installation options.
You can use pip to install it:
pip install poetry
-
Install all dependencies with Poetry:
poetry install --no-dev
If you didn't create and activate a virtual environment in step 1, Poetry creates one for you and installs all dependencies there. To use this virtual environment, run:
poetry shell
pre-commit is used for managing hooks that run before each commit, to ensure code quality and run some basic tests. Thus, this needs to be set up only when one intends to commit changes to git.
-
Activate the virtual environment where you installed the dependencies.
-
Install all dependencies, including extra dependencies for development:
poetry install
-
Install pre-commit hooks:
pre-commit install
NOTE: You need to be inside the virtual environment where you installed the above dependencies every time you commit.