Skip to content

raylib.ImageFromChannel

JoeStrout edited this page Nov 16, 2026 · 3 revisions

Create a grayscale image from a selected channel (0-3 for R, G, B, A) 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