Skip to content

raylib.ImageAlphaCrop

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Crop image depending on alpha value NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f

Parameters

Parameter Default Value Note
image
threshold

Return value

None.

Notes

Example

img = raylib.LoadImage("sprite.png")
// Crop away all transparent border pixels (threshold 10%)
raylib.ImageAlphaCrop img, 0.1
raylib.ExportImage img, "sprite_cropped.png"
raylib.UnloadImage img

Clone this wiki locally