Nine patch image optimiser

Nine Patch Image Optimiser

I have the little python script to make the nine patch image from original one:

Github link: GitHub - Insality/nine-patch-optimizer: Tool to make 9patch from images. Optimize image size

Usage

You can pass the single image or folder (see README at github) and you will get next output for each processed image:

Image: button_purple.png
Output: button_purple.png
Origin Size: 368x128
New Size: 122x128
9Patch side: [60, 0, 60, 0]
Saved: 66.85%

To use image in Defold as before, set in the editor nine patch settings:
60 (from left) 0 (from top) 60 (from right) 0 (from bottom)
and set node size to origin size:
Origin Size: 368x128

Hope it can be useful for you :slight_smile:

14 Likes

This is fantastic!

Seems like this will enable us to design UI in the final dimensions. Sounds like a big workflow improvement.

2 Likes

This is the main reason to create this tool for me! It’s much easier to ask your artists draw 1:1 art and later if required I can with only myself change it to 9patch optimised images.

2 Likes