Search Unity

How to save tilemap to jpg?

Discussion in '2D' started by Bagazi, Apr 20, 2019.

Thread Status:
Not open for further replies.
  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Is there some way to save a tilemap tiles into image like jpg?
    upload_2019-4-20_10-59-20.png
    Like this selecting blocks, I want to save it into image..
     
  2. Deleted User

    Deleted User

    Guest

    I don't think there is a way to do that.

    The best way would be to use an image editor and make a montage of your sprites reproducing the pattern on a transparent background.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  4. beanie4now

    beanie4now

    Joined:
    Apr 22, 2018
    Posts:
    311
    Not what you asked for but happened to be working with it... maybe it will be of more than 0 use.
    Code (CSharp):
    1. public void WriteSpritetoPNG(Sprite image)
    2.     {
    3.         var Bytes = image.texture.EncodeToPNG();
    4.         File.WriteAllBytes(Application.persistentDataPath + "/" + image.name + ".png", Bytes);
    5.     }
     
  5. leocub58

    leocub58

    Joined:
    Aug 8, 2015
    Posts:
    1
  6. Ghettodeveloper

    Ghettodeveloper

    Joined:
    Aug 6, 2023
    Posts:
    2
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,456
    Please use the Like button to show appreciation so you don't necro threads for everyone.

    Thanks.
     
Thread Status:
Not open for further replies.