Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

rharish101/imgtools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgtools

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.

Instructions

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

Setup

Poetry is used for conveniently installing and managing dependencies.

  1. [Optional] Create and activate a virtual environment with Python >= 3.9.

  2. 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
  3. 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

For Contributing

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.

  1. Activate the virtual environment where you installed the dependencies.

  2. Install all dependencies, including extra dependencies for development:

    poetry install
  3. 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.