Saving and Loading Images

You can use Easy Save to to load a JPEG or PNG image as a Texture2D. You can also save a Texture2D as a PNG.

You can load a JPEG or PNG file as a Texture2D using ES2.LoadImage.

For example, to load a JPG from a user’s hard drive into a GameObject’s material, you could use the following code:

To save a Texture2D as a PNG, you use the ES2.SaveImage method.

For example, to save the Texture2D assigned to a GameObject’s material, you could use the following code: