Skip to main content

Create .9.png Stretchable Images Create 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.

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.

Loading tool...

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 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

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

About This Tool

Nine-Patch Generator is a free online tool by FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration or installation required.