oleksii-zavrazhnyi / 9patcher

Automatic nine-patch tool that crops central part of image (buttons, inputs, backgrounds)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

9patcher

Automatic nine-patch tool that crops central part of image (buttons, inputs, backgrounds).

9patcher

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 me@themengzor.com

Requirements

  • BASH
  • Standard UNIX tools: mktemp
  • ImageMagick: identify, convert and montage binaries

Installation

git clone git@github.com:TheMengzor/9patcher.git
cd 9patcher
chmod +x ./9patcher.sh
sudo ln 9pather.sh /usr/bin/9patcher

Usage

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 ./btn_facebook@2x.png

About

Automatic nine-patch tool that crops central part of image (buttons, inputs, backgrounds)

License:The Unlicense


Languages

Language:Shell 100.0%