9-slice scaling (original) (raw)
9-slice scaling (also known as Scale 9 grid, 9-slicing or 9-patch) is a 2D image resizing technique to proportionally scale an image by splitting it in a grid of nine parts. The key idea is to prevent image scaling distortion by protecting the pixels defined in 4 parts (corners) of the image and scaling or repeating the pixels in the other 5 parts. A variation of the concept, the 3-slice scaling, consists in a grid of 3 parts in which only the pixels in 2 parts (the edges) are protected and the pixels on the middle part are repeated.