Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unable to slice sprite in Sprite Editor; Failed to create texture because of invalid parameters

Discussion in '2D' started by gantoine, Jan 29, 2020.

  1. gantoine

    gantoine

    Joined:
    Sep 24, 2017
    Posts:
    21
    Hello Unity Community,

    I'm hoping you can help me with a small problem I'm having with the Sprite Editor. I'm attempting to slice a sprite with the Sprite Editor, but when I click the 'Slice' button, Unity throws this error:

    UnityException: Failed to create texture because of invalid parameters

    I've checked all my sprite settings and I think they're okay. I did some research and found mention that there might be a maximum sprite size, but I can't find a definitive limit anywhere, so I don't think that's the problem.

    In Windows explorer the sprite sheet reports as being 15840 x 720 pixels. Here is a screenshot that has my sprite settings on the left, my slicing settings, and the error being thrown at the bottom:

    Sprite_Slice_Error.PNG

    Any suggestions on how to resolve this would be greatly appreciated. Thanks so much for your help!
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @gantoine

    Well that is definitely a very large texture... try cutting your texture to size of 4096x4096 (if you want to keep it POT + use compression) and see if it works then...
     
  3. TuckerFlynn

    TuckerFlynn

    Joined:
    May 18, 2015
    Posts:
    10
    It's a couple years old, but this post seems to have your answer.

    Summary: limit is 8192 x 8192, or less depending on hardware.
     
  4. gantoine

    gantoine

    Joined:
    Sep 24, 2017
    Posts:
    21
    Thanks for the replies! I'm having my artist provide another version of the spreadsheet with multiple rows so that it will fit within those dimensions. I'll post again once I've tried with the new sprite sheet.
     
  5. gantoine

    gantoine

    Joined:
    Sep 24, 2017
    Posts:
    21
    I got an updated sprite sheet from my artist today which had the sprites laid out in two rows instead of one and I was able to slice it with the Sprite Editor. Updated dimensions were 9360 x 1440. Still very large and the same area, but not tremendously long as the first one was. Hopefully this helps someone else in the future.