Skip to main content

PhotoFitter

A CLI app to fit your photos into canvases for printing.

More information in go.mianfg.me/photofitter.

Installation

You can install PhotoFitter using pip or manually, if you prefer.

Using pip

Simply request pip to install photofitter.

  $ pip install photofitter

Manual

Clone PhotoFitter's repo and run the code.

  $ git clone https://github.com/mianfg/photofitter
  $ cd photofitter
  $ python setup.py install

Usage

PhotoFitter includes a help command, simply type:

$ photofitter -h

You will get the full list of commands, as so:

usage: photofitter [-h] [-V] [-d DIMENSIONS] [-s SUBDIVISIONS] [-p PIXELS]
                   [-f FOLDER] [-l] [-B BACKGROUND_COLOR] [-L LINE_COLOR]
                   [-T LINE_THICKNESS] [-R] [-o OUTPUT] [-n NAME]
                   [-t STARTFROM] [-r REGEX] [-P]

This program will fit your photos into canvases for printing, and then
cutting. This script will take the images from the folder specified and fit
them into the specified dimensions, so that the images are as big as possible.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program version
  -d DIMENSIONS, --dimensions DIMENSIONS
                        dimensions of canvas to fit images, in
                        {width}x{height} mm [150x100 by default]
  -s SUBDIVISIONS, --subdivisions SUBDIVISIONS
                        subdivisions of canvas, in {columns}x{rows} [2x1 by
                        default]
  -p PIXELS, --pixels PIXELS
                        pixels for each mm [20 by default]
  -f FOLDER, --folder FOLDER
                        insert folder location [. by default]
  -l, --lines           show subdivision lines [not by default]
  -B BACKGROUND_COLOR, --background-color BACKGROUND_COLOR
                        background color of image, in HTML [ffffff by default]
  -L LINE_COLOR, --line-color LINE_COLOR
                        color of lines, in HTML [000000 by default]
  -T LINE_THICKNESS, --line-thickness LINE_THICKNESS
                        thickness of lines, in px [2 by default]
  -R, --recursive       iterate folder recursively [non-recursive search by
                        default]
  -o OUTPUT, --output OUTPUT
                        location of output folder [./output by default]
  -n NAME, --name NAME  output name prepended to every image [fitter by
                        default]
  -t STARTFROM, --startfrom STARTFROM
                        number to start output filename with [0 by default]
  -r REGEX, --regex REGEX
                        regular expression: only files matching the regular
                        expression will be parsed [.* by default]
  -P, --print-params    print parameters

Here are more detailed explanations on each of the commands:

Command name Directive Description
Help -h, --help Receive help about how to use PhotoFitter. Overrides all commands
Version -V, --version Version information
Canvas dimensions -d DIMENSIONS, --dimensions DIMENSIONS Dimensions, in mm, of the canvas in which the photos will be rendered. All the photos rendered will have these dimensions. DIMENSIONS must be in the format {width}x{height}. By default, dimensions are 150x100.
Subdivisions -s SUBDIVISIONS, --subdivisions SUBDIVISIONS Number of subdivisions of canvas in which the photos will be fit. SUBDIVISIONS must be in the format {columns}x{rows}. By default, subdivisions are 2x1.
Resolution -p PIXELS, --pixels PIXELS Specifies the image resolution, in pixels per mm. By default, resolution is 20.
Folder -f FOLDER, --folder FOLDER Folder route to retrieve images. Route can be relative or absolute. By default, route is .
Show lines -l, --lines Show lines in subdivisions
Background color -B BACKGROUND_COLOR, --background-color BACKGROUND_COLOR Background color of canvases. BACKGROUND_COLOR must be a color in hex form, six characters. By default, background color is FFFFFF.
Line color -L LINE_COLOR, --line-color LINE_COLOR Line color for subdivisions (see show lines). LINE_COLOR must be a color in hex form, six characters. By default, line color is 000000.
Recursive iterating -R, --recursive Iterate images in folder recursively.
Output foler -o OUTPUT, --output OUTPUT Route to export images, can be absolute or relative. If folder does not exist, it will be generated.
Output name -n NAME, --name NAME Rendered filenames will be of the format {NAME}_{NUMBER}.jpg. By default, output name is fitter.
Output start number -t STARTFROM, --startfrom STARTFROM Rendered filenames will be of the format {NAME}_{NUMBER}.jpg, with NUMBER being STARTFROM + INDEX, with INDEX being the number of picture generated, starting from 0 and incrementing by 1. By default, output start number is 0.
Regex -r REGEX, --regex REGEX Only files matching the regular expression REGEX will be parsed. By default, regex is .* (all files)
Print parameters -P, --print-params Print dict of parameters

Metadata

Release files for photofitter 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for photofitter 1.0.1
File Size Uploaded
photofitter-1.0.1.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for photofitter 1.0.1
File Interpreter ABI Platform
photofitter-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / photofitter-1.0.1.tar.gz

Download URL photofitter-1.0.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1399d7344322f1b6edc9120fcd51172bc29b480334ff14b2f671ff11ead5be7d
BLAKE2b-256 checksum
How to use checksums
015e72bce37ddc41e267fdde6a47650d5500a2a29426f6c920d7c1c827441ecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9

Release files / photofitter-1.0.1-py3-none-any.whl

Download URL photofitter-1.0.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08b8541aa9bc2e7c0404142355d6f2f0c7304bafb023ff7185fc5605113bbbf2
BLAKE2b-256 checksum
How to use checksums
2c29ad075bd36f2d2eb088a7d505583fc2a93e347017b6fe6fa1f349103439ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page