Skip to content

raylib.ImageCrop

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Crop an image to area defined by a rectangle NOTE: Security checks are performed in case rectangle goes out of bounds

Parameters

Parameter Default Value Note
image
crop

Return value

None.

Notes

Example

img = raylib.LoadImage("photo.png")
// Keep only the top-left 64x64 region
raylib.ImageCrop img, {x:0, y:0, width:64, height:64}
raylib.ExportImage img, "photo_cropped.png"
raylib.UnloadImage img

Clone this wiki locally