Skip to content

raylib.ImageFromChannel

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Create an image from a selected channel of another image

Parameters

Parameter Default Value Note
image
channel

Return value

Condition Return Value
(always) map

Notes

Example

img = raylib.LoadImage("photo.png")
// Extract the red channel (channel 0) as a grayscale image
redChannel = raylib.ImageFromChannel(img, 0)
raylib.ExportImage redChannel, "red_channel.png"
raylib.UnloadImage redChannel
raylib.UnloadImage img

Clone this wiki locally