Free Toolkit

Nine-Patch GeneratorCreate Android-style 9-patch (.9.png) images with stretchable region markers.

Nine-Patch Generator illustration
🖼️

Nine-Patch Generator

Create Android-style 9-patch (.9.png) images with stretchable region markers.

How to Use
1

Upload Image

Drop or select a PNG image for 9-patch creation.

2

Define Regions

Set left, right, top, and bottom insets for stretchable areas.

3

Download

Generate and download the .9.png file with markers.

What Is Nine-Patch Generator?

A nine-patch generator that creates .9.png images used in Android development and game UI systems. Nine-patch images have 1-pixel border markers that define which regions stretch and which stay fixed. Set the inset values (left, right, top, bottom) to control where the stretchable zone begins and ends. The tool adds the required 1px border with black pixel markers. Output is compatible with Android SDK and popular game engines.

Why Use Our Nine-Patch Generator?

  • Creates properly formatted .9.png files
  • Visual controls for stretch region definition
  • Compatible with Android SDK and game engines
  • Preview with pixel-accurate rendering

Common Use Cases

Android Development

Create stretchable backgrounds for buttons and chat bubbles.

Game UI

Scalable UI panels and frames for different screen sizes.

Responsive Assets

Images that scale gracefully by stretching only designated areas.

Chat Bubbles

Chat message backgrounds that expand with text content.

Technical Guide

The output image is 2 pixels wider and 2 pixels taller than the source (for the 1px border on each side). The source image is drawn at offset (1,1). Black pixels are placed on the borders: top border marks horizontal stretchable width, left border marks vertical stretchable height, right border marks content padding height, bottom border marks content padding width. The stretchable region is the area between the insets.

Tips & Best Practices

  • 1
    Keep insets away from detailed areas — only flat/simple areas should stretch
  • 2
    Test at various sizes to verify stretch behavior
  • 3
    Use with Android SDK draw9patch tool for verification
  • 4
    Corners and edges with detail should be in the fixed (non-stretch) zone

Related Tools

Frequently Asked Questions

QWhat is .9.png?
A PNG with 1px border markers defining stretchable and padding regions.
QAndroid only?
Originally Android, but also used in many game engines and UI frameworks.
QInput format?
PNG only — markers require lossless pixel data.
QPreview stretch?
Check the output visually. Use Android SDK tools for stretch preview.
QMax insets?
Up to half the image dimension for each side.

About Nine-Patch Generator

Nine-Patch Generator is a free online tool from FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration required. No ads. Just fast, reliable tools.