Skip to main content

pyFormal

pyFormal is a tool for creating formal figures of grids of images in Python. This tool allows users to take a folder of images and transform them into a neatly formatted grid with desired parameters such as label font size, border width, blur intensity, and more.

Prerequisites

Before you can use pyFormal, you need to install a LaTeX distribution:

  • For macOS users: Install MacTeX.

    brew install --cask mactex-no-gui
    
  • For Windows users: Install MiKTeX.

  • For Linux users: Most distributions have TeX Live in their repositories. For example, on Debian/Ubuntu:

    sudo apt-get install texlive-full
    

Installation

Once the prerequisites are installed, you can install pyFormal via pip:

pip install pyFormal

Usage

To use pyFormal, navigate to the directory containing your images and run the following command:

pyFormal --label_font_size <FONT_SIZE> --use_clipboard_for_folder_path <TRUE/FALSE> --save_folder_path <FOLDER_PATH> --border_width_ratio <BORDER_RATIO> --blur_intensity <BLUR_INTENSITY> --manual_image_folder_path <MANUAL_PATH> --border-color <BORDER_COLOR> --resize-mode <RESIZE_MODE>

Options:

  • --label_font_size, -l: Font size for the image labels (default: 18).
  • --use_clipboard_for_folder_path, -c: Use the clipboard for the folder path (default: True).
  • --save_folder_path, -f: Folder path to save the images (default: './pyFormal-figures').
  • --border_width_ratio, -b: How much to make the border width of the output image (default: 0.01).
  • --blur_intensity, -i: How intense to make the border width blur (default: 10).
  • --manual_image_folder_path, -m: Manually enter the image folder path. To use this, use_clipboard_for_folder_path must be set to False (default: None).
  • --border-color, -bc: Color of the border (default: 'white').
  • --resize-mode, -r: Mode for resizing the images. Options are "crop" and "pad" (default: 'crop').

Example 1: Using Clipboard Path

If you've copied the path to your folder (e.g., C:\Users\Username\Documents\my_images) to your clipboard, you can utilize the clipboard to fetch the path directly and run the command simply with all of the default settings like so:

pyFormal

By default, pyFormal will try to use the folder path from the clipboard if the --use_clipboard_for_folder_path option is not set to False. In this example, the application will fetch the path from your clipboard, create a grid of images, and save the output in the pyFormal-figures folder using the default settings. Furthermore, once you close the figure preview window, it will copy the image data to your clipboard so it can be pasted easily into whatever document you are working on.

Example 2: Specifying the Image Folder in the Command Line

Assuming you have a folder named my_images and you want to save the grid to a folder named output, you would run:

pyFormal -c False -m ./my_images

This will create a grid of images from the my_images folder and save the output in the pyFormal-figures folder using the default settings.

Contributing

If you find any issues or have suggestions, please open an issue!

Metadata

Release files for pyFormal 0.1.7

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

Source distribution (sdist)

Source distribution for pyFormal 0.1.7
File Size Uploaded
pyFormal-0.1.7.tar.gz 7.3 kB Details

Built distribution (wheel)

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

Total release size: 15.5 kB

Release files / pyFormal-0.1.7.tar.gz

Download URL pyFormal-0.1.7.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
04485566f9c66d1ba2d128b94a6c77f19684763c5e6c729618333cbe8749f03a
BLAKE2b-256 checksum
How to use checksums
b9a51431189cb1846a04211bf2b865c33708982883a3a16b7a90b31b625aa773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyFormal-0.1.7-py3-none-any.whl

Download URL pyFormal-0.1.7-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3caccae612844088c460bd577af63943450e2da5d4776fe57aee9fb5a16a8bd1
BLAKE2b-256 checksum
How to use checksums
8cbb0adfd9b7d0da6528481de2d74c28f6d15bde209567cc2d106fe5a4a960b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.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