Getting texture pixel data

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Truc4

I am trying to make a tv give off a glow, and I want this glow to roughly match the color of the texture it is currently displaying. How do I get the current color of the texture? I want to have access to this color from other places so a shader doesn’t seem to work. Can you read texture fragments from a normal script?

:bust_in_silhouette: Reply From: droc101

I know with an Image, there is a get_pixel(x,y) function, to use it, you need to convert the texture to an Image resource, and call image.lock() firs, then you can use image.get_pixel()