• Manual
  • API Documentation
  • Guides
  • Saving and Loading Images

    Show / Hide Table of Contents
    • Introduction
    • Installation
    • Getting Started
    • Demos
    • The Save System API
    • Auto Save
    • Platforms
    • Security
    • Serialization
    • Supported Data Types
    • Migration
    • FAQ
    • Changelog
    • Extend
      • Overview
      • Converter
      • Encryption
      • Storage
    • Guides
      • Overview
      • Configuring Settings
      • Using Auto Save
      • Basic Saving and Loading
      • Saving and Loading Raw Data
      • Deleting the Data
      • Saving and Loading Images
      • Saving and Loading Scene Objects
      • Saving and Loading Assets
      • Saving and Loading Readonly Properties
    • Integrations
      • Overview
      • Google Play Games
      • Xbox Live
      • Bolt
      • Firebase
      • PlayFab
      • PlayMaker
      • Steam Auto-Cloud
      • Steamworks .NET
      • Facepunch Steamworks
      • Text Mesh Pro
    • Storage
      • Overview
      • Backup
      • Catalog
      • Meta Data
      • Built-in Storages
        • File
        • PlayerPrefs
        • Memory
      • Third-party Storages
        • Firebase
          • Realtime Database
          • Cloud Storage
          • Firestore
        • PlayFab
          • Entity Objects
          • Entity Files
          • User Data
        • Steam
          • Steamworks .NET
          • Facepunch Steamworks
        • Google Play
          • Saved Game
        • Xbox Live
          • Connected Storage

    Saving and Loading Images

    Using the SaveSystemAPI API for saving images, you can save a texture as an image file:

    • PNG: SaveSystemAPI.SaveImagePNGAsync
    • JPG: SaveSystemAPI.SaveImageJPGAsync
    • EXR: SaveSystemAPI.SaveImageEXRAsync

    And then you can load them back using the SaveSystemAPI.LoadImageAsync method.

    Saving a Texture as PNG

    async void Start() {
    
        // The name of the image file (you can provide an absolute path too)
        string identifier = "image.png";
    
        // The simple data we're going to save
        Texture2D myTexture = Resources.Load<Texture2D>("myTexture");
    
        // Save the data associated with the identifier
        await SaveSystemAPI.SaveImagePNGAsync(identifier, myTexture);
    
        // Load back the saved data associated with the identifier
        Texture2D loadedTexture = await SaveSystemAPI.LoadImageAsync(identifier);
    }
    
    • Improve this Doc
    • 0 Comments
    In This Article
    • Saving a Texture as PNG