Garry's Mod Wiki

surface.GetTextureSize

  number, number surface.GetTextureSize( number textureID )

Description

Returns the size of the texture with the associated texture ID.

For .png/.jpg textures loaded with Material you can use the $realheight and $realwidth material parameters (IMaterial:GetInt) to get the size of the image.

Arguments

1 number textureID
The texture ID, returned by surface.GetTextureID.

Returns

1 number
The texture width.
2 number
The texture height.