Code: Select all
RIFFvc. SPRTsprshttp://www.mediafire.com/file/o3fr3n602 ... prite/file
Code: Select all
RIFFvc. SPRTsprsCode: Select all
meta:
id: img_raw
file-extension: img_raw
encoding: ascii
endian: le
seq:
- id: magic
contents: "IMG fmt L\0\0\0"
- id: data_name
type: str
terminator: 0
- id: unk_fill
size: 54
# repeats 0xfe
- id: unk_data
type: u4
- id: compression
contents: "lz4 "
- id: width
type: u2
- id: height
type: u2
- id: data_magic
contents: "data"
- id: data_len
type: u4
- id: compressed
size: data_lenCode: Select all
from img_raw import ImgRaw
import lz4.block as lb
from PIL import Image
import sys
if __name__ == "__main__":
name = sys.argv[1]
img = ImgRaw.from_file(name)
res = lb.decompress(img.compressed, uncompressed_size=img.width * img.height * 4)
res_img = Image.frombytes("RGBA", (img.width, img.height), res)
res_img.save(name + ".png")