imageBytesToCCFormat - FireDragon91245/CCT-Resource-API GitHub Wiki

imageBytesToCCFormat

signature:

imageBytesToCCFormat(
    texture: table {
        formatName: str,
        imageBytes: byte[]
    }
)

return: str (use with paintutils.parseImage)
performance impact: medium, low (for standard 16x16 textures)

examples

-- complete example on how to use with getBlockInfo and paintutils
local info = resourceapi.getBlockInfo("minecraft:grass_block", "m")
local texture = info.model.textures["block/grass_block_side"]
local str = resourceapi.imageBytesToCCFormat(texture)
local img = paintutils.parseImage(str)
paintutils.drawImage(img, 1, 1)

imageBytesToCCFormat_example