How do I easily load an Image file into an array of colours?

Hi all. So I have been digging around the internet for ages to find a way to read image data and then have a load the load the image into a colour array.

I have looked at @Maximum_ADHD’s PNG library, and it seemed promising, but I just couldn’t get it to work. I have no idea how to use it, and I cannot for the life of me find an example or proper documentation on how to use it anywhere.

So here I am. This is my last attempt to find a way how to read pixel data from an image via Roblox Studio (I don’t plan to load images into actual roblox games as this is for a plugin)

So how would I do this?

1 Like

You could have a look at @XAXA’s Local File Importer plugin, which can import files from the file system and use them temporarily in studio.

1 Like

Yes but it doesn’t allow me to get pixel data. I need a way to grab pixel colours

I’ve managed to get the PNG module to work

(required to be saved as local plugin, it then prints the color of a pixel at 10, 50)

2 Likes

Oh wow it does work! Can you please explain what you did to get the module to work? Cause I actually provided BinaryContents to the module, but it kept throwing errors at me.

Well, the only reason I can think of is that you didn’t have all the required files. I used RepoToRoblox to get the files directly into Studio, and then just passed File:GetBinaryContents() into PNG.new.

1 Like

Weird. So there wasn’t anything wrong with the original module? Huh, well thanks anyway!