A small tool for slicing images into smaller pieces.
import ImageSlicer
ImageSlicer.bysize("example.jpg", 2000, 2000, output_folder="sliced_by_size", keep_end_sections=True)
Function for slicing images by size
- Input file
- width of the new images
- height of the new images
- output path (optional)
- If you want to keep the end section, which are normally smaller (optional)
import ImageSlicer
ImageSlicer.bynumber("example.jpg", 2, 2, output_folder="sliced_by_number", keep_end_sections=True)
Function to slice images by number of parts you want to have so if the input is 10,10 you will get 100 images (depending if you want wo keep the smaller parts or not).
- Input file
- number of images horizontal
- number of images vertical
- output path (optional)
- If you want to keep the end section, which are normally smaller (optional)
Python 3.5+
Tested: Linux
These images are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.