Skip to content

Api > Texture2D > GetPixels()


Texture2D.GetPixels(number miplevel = 0)⚓︎

Gets the pixel color data for a mipmap level as Color structs.

Parameters:⚓︎

Name Type Description
miplevel number The mipmap level to get. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.

Returns:⚓︎

type Description
Color[] An array that contains the pixel colors.

Usage⚓︎

---@type Texture2D
local texture2d;

---@type number
local miplevel;


local val0 = texture2d.GetPixels(miplevel)

Extra Detail⚓︎

This method gets pixel data from the texture in CPU memory. Texture.isReadable must be true.