Package: imgwrench
Image WrenchA highly opinionated image processor for the commandline. Multiple subcommands can
be executed sequentially to form a processing pipeline.imgwrenchis free software available under the MIT license.
Detailed documentation can be found athttps://imgwrench.readthedocs.io.FeaturesSubcommands can be executed sequentially to form a pipelineCommandblackwhitefor converting images to black and whiteCommandcollagecreates a collage from multiple imagesCommandcolorfixfor fixing the colors of aged photographsCommandcropfor cropping images to give aspect ratioCommandditherfor converting images to black and white and ditheringCommandfilmstripto stack images horizontally forming a filmstripCommandflipto flip/mirror images left-rightCommandframeto put a monocolor frame around imagesCommandframecroptop frame and crop an image to a target aspect ratioCommandquadcollects four images to a quadCommandresizefor resizing imagesCommandsavefor no processing, but saving images with the given parametersCommandstackfor vertically stacking imagesInstallationMake sure you have Python and pip installed and available in your $PATH.
Thenimgwrenchcan be installed withpip install imgwrenchIn order to install for the current user only, you may want to executepip install --user imgwrenchinstead. In this case you will have to ensure that the local bin directory
(typically~/.local/binon Linux systems) is contained in your $PATH.Note that legacy Python2 is not supported. If your system still ships Python2
as the default Python interpreter, you may have to executepip3 install imgwrenchorpython3 -m pip install imgwrenchUsageimgwrenchis used on the command line by piping file paths into it, e.g.ls /path/to/my/images/*.jpg | imgwrench blackwhiteFull command line help isUsage: imgwrench [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

A highly opinionated image processor for the commandline. Multiple
subcommands can be executed sequentially to form a processing pipeline.

Options:
-i, --image-list FILENAME  File containing paths to images for processing,
                        defaults to stdin

-r, --repeat INTEGER       repeat every image in input sequence  [default:
                             1]

-p, --prefix TEXT          prefix for all output filenames before numbering
                        [default: img_]

-d, --digits INTEGER       number of digits for file numbering  [default: 4]
-c, --increment INTEGER    increment for file numbering  [default: 1]
-k, --keep-names           keep original file names instead of numbering
                        [default: False]

-f, --force-overwrite      force overwriting output image file if it exists
                        [default: False]

-o, --outdir DIRECTORY     output directory  [default: .]
-q, --quality INTEGER      quality of the output images, integer 0 - 100
                        [default: 88]

-e, --preserve-exif        preserve image exif and xmp metadata if available
                        [default: False]

-j, --jpg / --png          save output images in JPEG format (otherwise PNG)
                        [default: True]

--help                     Show this message and exit.

Commands:
blackwhite  Convert color images to black and white.
collage     Create a collage from multiple images.
colorfix    Fix colors by stretching channel histograms to full range.
crop        Crop images to the given aspect ratio.
dither      Apply black-white dithering to images.
filmstrip   Stack all images horizontally, creating a filmstrip.
flip        Flip/mirror images left-right.
frame       Put a monocolor frame around images.
framecrop   Crop and frame an image to a target aspect ratio.
quad        Collects four images to a quad.
resize      Resize images to a maximum side length preserving aspect...
save        No-op to enable saving of images without any processing.
stack       Stacks pairs of images vertically, empty space in the middle.Pipelinesimgwrenchsubcommands can be combined into pipelines. This saves you from generating intermediate
files cluttering your filesystem or reducing the quality of the final results. For example, if you
want to convert all images in the current directory to black and white, put a white frame
around them and have them cut to an aspect ratio of 3:2 (for standard format printing), you would
execute the following command:ls *.JPG | \
imgwrench -o out -q 95 -p oldschool_img_ \
        blackwhite \
        framecrop -a 3:2 -w 0.03 -c whitePlease refer to thedetailed subcommand documentationfor the individual parameters.Developer NotesShould you run into the following exception while runningimgwrenchfrom an editable installimportlib_metadata.PackageNotFoundError: No package metadata was found for imgwrenchtry executingmake distto regenerate theeggfiles required beiimportlibwhich have likely been removed by a call tomake clean.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.17.0 (2022-11-12)-r/--repeatoption for repeating input filesConstrainclickversion to<8.1due to breaking API change; this will be relaxed in a future versionConstrainPillowversion to<9.0due to breaking tests; this will be relaxed in a future versionDrop support for Python 3.6 and 3.7Add support for Python 3.9 and 3.10Upgrade dependenciesMigrate from travis-ci.com to GitHub actions0.16.1 (2021-06-19)Fix support forclick>=8.0which has changed its behaviour regarding custom parameter types0.16.0 (2021-01-23)quadsubcommand supports doubling inner frame using the-d/--double-inner-frameflag0.15.0 (2021-01-22)collagesubcommand selects best layout based on score functioncollagesubcommand supports-n/--number-triesparameter to specify number of layout tries0.14.0 (2021-01-21)BREAKING CHANGE: replace golden collage approach with BRIC algorithm incollagesubcommandBREAKING CHANGE: drop support for Python 3.5format code withblack0.13.0 (2020-10-26)quadsubcommand to to collect four images into a quadimprove documentation0.12.0 (2020-07-24)flipsubcommand to flip/mirror images left-rightMonkey patchIFDRational.__eq__method of Pillow in tests to avoid regression with Pillow 7.2.00.11.1 (2020-04-05)-x/--seedoption for collage to control initialization of random number generator0.11.0 (2020-03-21)collage subcommand for creating a framed collage from imagesBREAKING CHANGE: default method for colorfix is now quantiles-fixed-cutoffpreserve xmp metadata when-e/--preserve-exifis used (in addition to exif metadata)0.10.0 (2020-03-04)-m/--methodoption to colorfix (default: quantiles)add fixed-cutoff as new method to colorfix accepting fixed colors as color cutoff boundariesadd quantiles-fixed-cutoff as new method to colorfix combining quantiles and fixed-cutoffdeprecate running colorfix without specifying method (as default will change in next version)0.9.0 (2020-02-19)add numpy as dependencychange colorfix algorithm to vectorized numpy code for performancesupport Python 3.80.8.1 (2020-01-12)fix crash when orientation is missing in exif headers0.8.0 (2019-07-10)dither subcommand for ditheringfilmstrip subcommand to stack images horizontallyimages can be saved in PNG format using--pngCLI flag0.7.1 (2019-05-16)fix development status0.7.0 (2019-05-16)option for preserving exif image metadatafix error when running with-k/--keep-namesstatus progress to Alpha0.6.0 (2019-03-14)framecrop subcommand to crop and frame an image to a target aspect ratio incl. tests and docsbreaking change: moved command modules tocommandspackageintroduced ImageInfo as a container for additional meta information in the pipelineincreased test coveragemore documentation0.5.2 (2019-03-10)use a custom parameter type for colors0.5.1 (2019-03-09)changed default frame width to 0.025usage doc for frame subcommandconsistent alphabetic sorting of subcommandsuse a custom parameter type for ratios0.5.0 (2019-03-07)blackwhite subcommand to convert color images to black and white; incl. docframe subcommand to put a monocolor frame around images; incl. tests0.4.0 (2019-02-26)convert RGBA mode PNG images to RGB (to enable saving as JPG)crop subcommand to crop images to a specified aspect ratiodocumentation for colorfix and crop0.3.0 (2019-02-17)-d/--digitsoption to specify number of digits in file names-c/--incrementoption to define increment for file numberingcreate non-existing output folder instead of complaining0.2.0 (2019-01-30)no-op save command for only saving imagesraise exception if output image already exists-f/--force-overwriteflag to enable overwriting outputtests for cli, pipeline and resize0.1.1 (2019-01-29)Fix __main__ module0.1.0 (2019-01-29)First release on PyPI.