Skip to main content

A package that lets you quickly split an image into rows and columns (tiles).

Project description

split-image

Downloads Downloads

Quickly split an image into rows and columns (tiles).

split-image is a Python package that you can use from the command line to split an image into tiles.

Installation

pip install split-image

Usage

From the command line:

split-image [-h] [-s] image_path rows cols

Basic examples

split-image cat.png 2 2

This splits the cat.png image in 4 tiles (2 rows and 2 columns).

split-image bridge.png 3 4 -s

This splits the bridge.png image in 12 tiles (3 rows and 4 columns). The -square arguments resizes the image into a square before splitting it. The background color used to fill the square is determined from the image automatically.

Other options

Reverse split:

split-image bridge.jpg 2 2 -r

Will attempt to merge similarly named image tiles to one image. So, if you have these images in the current directory:

  • bridge_0.jpg
  • bridge_1.jpg
  • bridge_2.jpg
  • bridge_3.jpg

they will be merged according to their file name:

Cleanup:

split-image test.jpg 4 2 --cleanup

Will delete the original image after the process.


positional arguments:
  image_path    The path of the image to split.
  rows          How many rows to split the image into (horizontal split).
  cols          How many columns to split the image into (vertical split).

optional arguments:
  -h, --help      Show this help message and exit
  -s, --square    If the image should be resized into a square before splitting.
  -r, --reverse   Reverse the splitting process, i.e. merge multiple tiles of an image into one.
  --cleanup       After splitting or merging, delete the original image/images.


Cat photo by Manja Vitolic on Unsplash

Bridge photo by Lance Asper on Unsplash

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

split-image-1.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

split_image-1.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file split-image-1.2.0.tar.gz.

File metadata

  • Download URL: split-image-1.2.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for split-image-1.2.0.tar.gz
Algorithm Hash digest
SHA256 bd2250cf245573df1a0ecdb2a708acd06c94e7a8c06bdc3b2fd50cb659915dc2
MD5 6dd26eb5cc9abf1345b43918ab4eea46
BLAKE2b-256 0c50904d9293de6e6e47d300a3e1d55c754a9bc06982fb9faf68e3cdd9b1f5a9

See more details on using hashes here.

File details

Details for the file split_image-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: split_image-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for split_image-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce8a061484bec91f266e77ebdb02abe3d2946a221af8fd7b3fd291445f54920d
MD5 71a5b2220e31673678303f39f7aeb4d9
BLAKE2b-256 a5b07c7777bc73382821d9dcfb382c648b429357cde2db03c53bcaa4f5c57e41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page