An application to create a grid of nicely formatted images from a folder of images.
Project description
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!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyFormal-0.1.7.tar.gz
.
File metadata
- Download URL: pyFormal-0.1.7.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04485566f9c66d1ba2d128b94a6c77f19684763c5e6c729618333cbe8749f03a |
|
MD5 | 46c395d80a497c106767c4ee90f64f4b |
|
BLAKE2b-256 | b9a51431189cb1846a04211bf2b865c33708982883a3a16b7a90b31b625aa773 |
File details
Details for the file pyFormal-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: pyFormal-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3caccae612844088c460bd577af63943450e2da5d4776fe57aee9fb5a16a8bd1 |
|
MD5 | 72082b42be08885626d768dcc9fe6b53 |
|
BLAKE2b-256 | 8cbb0adfd9b7d0da6528481de2d74c28f6d15bde209567cc2d106fe5a4a960b1 |