The Advanced Edge Padding is a script that dilates pixels around the border of an alpha texture. It prevents color ‘bleed’ and produces a similar effect to the one described here. This code is especially useful if you need to apply edge padding programmatically at runtime. The padding method is customizable, and it is very efficient because textures are processed by image effect shaders.

  • optional edge trimming before padding (to get rid of ‘dirty’ pixels on the border)
  • supports two dilating techniques: 4-way (fast), and 8-way (more precise)
  • customizable number of padding iterations
  • includes documentation

* suitable for desktop and mobile