blueprint image data question

  • hey @red51 I was trying to add the option for my Blueprint editor to save the image as a png file but then I noticed that before the RGBA values start there are a few (19 to be exact) extra bytes. What are these used for? To be more specific these bytes are after the 4 bytes that signify the imagedata length and before the actual RGBA values start. For instance in a random blueprint I just opened:


    00100013 000002000000020005414247523800100000FF 596264FF686F71FF747B7CFF697273FF6F7374FF


    first segment imagedata length
    second segment the unknown bytes
    third segment the start of the actual RGBA imagedata


    Edit: to add another question since I did some experimenting, are the bytes in the order RGB or some other order (GRB, BGR, etc.) because I am getting correct but very weirdly coloured images :/ ?

  • These bytes contain information about the image width + height, the image format, the image data itself and optionally the mipmap data (in this case it's unused):

    bytes441x4x1x
    descimg widthimg heightformat lengthformat (String)imagedata lengthimagedatamipmapdata lengthmipmap data


    Since the blueprint preview image is created from a BufferedImage, the texture uses a ABGR8 format (i.e. 1 byte per color value [alpha, blue, green, red]) ;)
    The mipmap data isn't used for the blueprint textures, so you can expect a single byte (-1) at the end

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!