Apr 7, 2013

Panorama splitter in python

I developed small python script application for splitting panorama image to multiple slices, which can be printed on home photo printers and then stick together.

This script need PIL (python image library) installed in python with proper image libraries. For windows users, use PIL installer which have all included. For Linux Ubuntu users, install proper libraries (apt-get install libjpeg8 libpng12-0 libfreetype6 zlib1g), create symlinks for them in /usr/lib :
$sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib

$sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
 and then install with `pip install -U PIL` manual here.
See  panosplit source code here.



Examples of use:


# split image to 4 slices horizontally, named slice:
panosplit.py pano_image.tif -h 4 -o slice

# split image to 4 slices horizontally and extend horizontal slice to 1 mm. For slice extending, paper format need to be defined.
panosplit.py pano_image.tif -h 4 -f A4 -eh 1 -o slice


# split image to 4 slices horizontally  and 2 slices vertically, and extend horizontal slice to 1 mm. and  1mm horizontally. For slice extending, paper format need to be defined.
panosplit.py pano_image.tif -h 4 -v 2 -f {'h':210,'v':297} -eh 1 -ev 1

Michal;

No comments:

Post a Comment