Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Extract sprite from Texture2D/Remove sprite from Texture2D

Discussion in '2D' started by ryanas, May 24, 2021.

  1. ryanas

    ryanas

    Joined:
    Oct 2, 2013
    Posts:
    14
    I am using the PSDImporter to bring in a psb file with a sprite atlas generated. Unfortunately, some of the sprites are too big and I'd like to highlight these sprites and essentially remove them from the Texture2D.

    Modifying the Texture2D seems sketchy so I was trying to copy the sprites I want as separate assets and then repack them in a new sprite atlas but all references to the sprites texture will reference the atlas because it is packed.

    Is there a way of hard copying over sprite information in a Texture2D and copying it to Texture2D without particular sprites?

    If not, is there a way of essentially cropping and saving all of these sprites that I want as individual assets to them repack into a new Texture2D?

    Thanks