krkr大多數是psb檔頭,你garbro解原檔出來,把所有pimg一次過拖去PsbDecompile.exe json會有各種資料,如x,y,但很難看,要自己研究
@ #2 你把这个项目 clone 下来,然后把 main.py 中的 pimgexportlayers 函数改成下面这样就可以解包所有 pimg 图片了 def pimgexportlayers(pimgpath, imageformat=".png"): imgpath, jsonpath, resxpath = pimgdecode(pimg_path) outputprefix = "./output/{}" + imageformat with open(json_path) as f: j = json.load(f) with open(resx_path) as f: jr = json.load(f) def layer_id2path(lid: str): return pimg_path.parent.joinpath(jr["Resources"][str(lid)]) width = j["width"] height = j["height"] for i, layer in enumerate(j["layers"]): layerid = layer["layerid"] name = layer.get("name", f"layer_{i}") left, top = layer["left"], layer["top"] pm = Image.open(layerid2path(layerid)) im = Image.new("RGBA", (width, height), (0, 0, 0, 0)) im.paste(pm, (left, top), pm if pm.mode == "RGBA" else None) safename = name.replace("/", "").replace("\\", "_") im.save(outputprefix.format(safename)) pm.close() shutil.rmtree(imgpath.withsuffix("")) json_path.unlink() resx_path.unlink()
现场搜的,我也没用过,你可以试试 我一般只解包 CG 做壁纸,所以我直接拿一张完整的底图就可以,没有用合成