-
Notifications
You must be signed in to change notification settings - Fork 2
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
| Parameter | Default Value | Note |
|---|---|---|
| image | ||
| threshold |
None.
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