Skip to content

raylib.GetImageAlphaBorder

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Get image alpha border rectangle NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f

Parameters

Parameter Default Value Note
image
threshold

Return value

Condition Return Value
(always) map

Notes

Example

img = raylib.LoadImage("sprite.png")
// Get the bounding rectangle of non-transparent pixels (threshold 10%)
rec = raylib.GetImageAlphaBorder(img, 0.1)
print "content rect: " + rec.x + "," + rec.y + " " + rec.width + "x" + rec.height
raylib.UnloadImage img

Clone this wiki locally