Skip to content

Prepare your images for printing! Crop, up/down-scale given the DPI-Print Size

License

Notifications You must be signed in to change notification settings

Zacros/pyframing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prepare your images for printing!

This tool will crop the image at the center and then up/down-scale based on the DPI-Print Size given

Standalone usage via terminal

virtual env recommended

pip3 install -r requirements.txt

Params Required

  • imgPath : Path to the image
  • print_size : Print size in inches, example 10x12
  • DPI : Dots Per Inch, example 300

Usage example

python pyframing.py test_image.jpg 10x12 300

The processed image will be saved at the same path of the original image.

Usage as a lib

Core functions to use

# Load the image
image = cv2.imread(".../test.jpg")

# Prepare the image for printing
ready_to_print_image= crop_fit_to_inch_dpi(image, inch_size = [5, 7], dpi =300)

# Save image as a file
save_cv2_image(image, path, dpi, params = None)

About

Prepare your images for printing! Crop, up/down-scale given the DPI-Print Size

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages