GithubHelp home page GithubHelp logo

et0and / contact-sheet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cobanov/contact-sheet

0.0 0.0 0.0 12.6 MB

Contact Sheet Generator is a Python script that generates a contact sheet from a directory of images.

License: Apache License 2.0

Python 100.00%

contact-sheet's Introduction

Contact Sheet Generator

Contact Sheet Generator is a Python script that generates a contact sheet from a directory of images. It uses the PIL library to process images and multiprocessing to generate thumbnails in parallel. The contact sheet is created by arranging the thumbnails in a grid pattern.

Also, it generates grid pattern without cropping the images. It supports both vertical and horizontal. All images automatically fit into the final grid pattern. You can use this feature with --no-crop argument in command line.

Requirements

  • Python 3.x
  • PIL library (pillow package)
  • multiprocessing module
  • tqdm library
  • rectpack library
  • wand library

Usage

  1. Clone the repository:
git clone https://github.com/cobanov/contact-sheet-generator.git
  1. Install the required dependencies.
pip install -r requirements.txt
  1. Place your images in a directory.

  2. Open the command prompt or terminal and navigate to the project directory.

  3. Run the script with the following command:

python contact_sheet.py /path/to/images output_contact_sheet.jpg
  1. Also, you can specify options with additional arguments (--img-size , --heic_to, --shuffle --no-crop)

important : if you want to use heic_to feature, please refer ImageMagick download page and install it for desired platform.

python contract_sheet.py /path/to/images --shuffle --heic_to jpeg --img-size 500 --no-crop result.jpg

Replace /path/to/images with the directory path containing the images you want to generate a contact sheet from, and output_contact_sheet.jpg with the desired output file path for the contact sheet.

  1. The script will start generating the contact sheet and display progress bars using the tqdm library.

  2. Once the process completes, the contact sheet will be saved to the specified output file path.

Arguments

Name Type Description
--image_dir str Path of image directory
--file_list(optional) str Path to the file list (filelist.txt) if available
--img-size(optional) int Adjust image size to process
--no-crop(optional) bool Create without cropping images, support v&h pictures
--heic_to str convert .HEIC images to desired( .jpg or .png)
--shuffle bool Shuffle thumbnail images for get different output
output_file str Output file name

Output

Additional Notes

The thumbnail_size variable in the script can be adjusted to control the size of the thumbnails in the contact sheet.

The script uses the center square crop technique to crop the images before generating thumbnails. This ensures that each thumbnail is a centered square.

The script utilizes multiprocessing to generate thumbnails in parallel, which can significantly speed up the process for a large number of images.

Progress tracking is added using the tqdm library, which displays progress bars while generating thumbnails and processing the images.

The temporary thumbnail directory used during the process will be cleaned up automatically after the contact sheet is generated.

Feel free to modify and customize the script according to your specific requirements!

License

This project is licensed under the MIT License

contact-sheet's People

Contributors

et0and avatar egemengulpinar avatar cobanov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.