How can I take a screenshot, without saving it as a PNG, but to a tex2d?

I have a problem. I am using the unity function “capturescreenshot”, and I am saving the image to my game’s save folder. However, the images take up too much space, so I want to take the screenshot as a tex2d, reduce the resolution, and convert it to a byte array, so it can be saved in the binary save file. I have so far been unable to take the screenshot as a tex2d, and there does not seem to be a function to convert it to a byte array. I also do not know how to convert a byte array back to a tex2d. I have the entire script already programmed, but I am now left with these two problems. It would be appreciated if anyone could help me solve this problem.

You can create a new Texture2D and call ReadPixels on it. Then you can encode to png or jpg or you can resize the texture and there’s the GetPixels32 which returns the color values as bytes. Look around in Texture2D functions here.
Also the camera has a targetTexture that may be useful for you.