globocom/thumbor — pull request #107 by swankjesse (2012-07-21 00:52:14+00:00)
Title: New frame filter that uses nine patch PNGs

This adds a new filter to thumbor that adds frames around the input
image. Frames are specified using nine patch files. These are regular
PNG files with a special convention that the one pixel perimeter of the
image defines stretchy regions (top and left edges) and padding
regions (right and bottom edges).

Nine patch is documented here:
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

There's also a nine patch editor called draw9patch included in the
Android SDK. Although nine patch originates on Android, the format
is general purpose.

Here's a full example:
Nine patch image: http://publicobject.com/ninepatch/frame.9.png
Source image: https://github.com/globocom/thumbor/wiki/tom_before_brightness.jpg
Thumbor URL:
http://localhost:8888/unsafe/filters:frame(http://publicobject.com/ninepatch/frame.9.png)/github.com/globocom/thumbor/wiki/tom_before_brightness.jpg
Output image: http://publicobject.com/ninepatch/framed.jpg