Automatic nine-patch tool that crops central part of image (buttons, inputs, backgrounds).
Easy in use: central 2 pixels will be stretchable.
Written in bash. Tested only on OS X 10.8.4
If you can test it on different systems, please feedback me with results on [email protected]
- BASH
- Standard UNIX tools: mktemp
- ImageMagick: identify, convert and montage binaries
git clone [email protected]:TheMengzor/9patcher.git
cd 9patcher
chmod +x ./9patcher.sh
sudo ln 9pather.sh /usr/bin/9patcher
Patch single file
9patch file
Patch several files
9patch file1 file2 ... fileN
Patch files by the mask (in this case all .png files)
9patch *.png
Most useful! Patch all files which names starts with button_
9patch button_*
Skip 40 pixels on the left (see example image with facebook buttons). Note that 40 is just an example, you can use any number in -skip parameter
9patch -skip 40 ./[email protected]