Web Design » Photoshop » How Do I Create a 9 Patch Image in Photoshop?

How Do I Create a 9 Patch Image in Photoshop?

Last updated on November 20, 2022 @ 4:33 am

Nine-patch images are a type of image resource that can be used as a background or other component of a graphical user interface (GUI) in Android applications. They are named “9-patch” because they are composed of nine images—the four corners, the four edges, and the center.

The corners are unscaled; the edges are scaled in one axis only; and the center is scaled in both axes. When the image is scaled, the unscaled corners remain fixed in size, and the edges and center expand or contract accordingly. This allows for a consistent look across different screen sizes and densities.

Creating a 9-patch image is simple:

1.Create a new image in Photoshop with dimensions that are a power of two (e.g., 512×512 pixels).

2.Draw your design within the image, keeping in mind that the area within the 1px border will be stretched or compressed when the image is used as a 9-patch.

3.Save the image as a PNG file.

Now that you have your 9-patch image, you can use it as a background or other component in your Android application. To do so, simply reference it like any other image resource.

Now that you have your 9-patch image, you can use it as a background or other component in your Android application.

PRO TIP: This tutorial is for advanced users of Photoshop only. If you are not an advanced user, please do not attempt to follow this tutorial.

To do so, simply reference it like any other image resource:


Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.