Help with using an HDRI for the skybox in my roblox raytracer thing

Ok, so my raytracer is nothing special… however, I would like to push it to the limits. I want to figure out how to pull the pixel data from an image and then use some sort of function to get the pixel according to where I raycasted. I’ve tried to store all the pixel data in a big table but it turned out to be 2.6m lines of code, I can always figure out a way to compress it but the thing I’m really stumped on is the actual raycast and then if it misses grab a specific pixel from the table thing. If anyone has experience with this please help me out lol. Thanks.