Python PSD layers?

前端 未结 5 1367
野的像风
野的像风 2021-02-03 14:39

I need to write a Python program for loading a PSD photoshop image, which has multiple layers and spit out png files (one for each layer). Can you do that in Python? I\'ve tried

5条回答
  •  感情败类
    2021-02-03 15:26

    Use psd_tools in Python

    from psd_tools import PSDImage
    
    psd_name = "your_name"
    x = 0
    psd = PSDImage.open('your_file.psd')
    
    for layer in psd:
        x+=1
        if layer.kind == "smartobject":
            image.conmpose().save(psd_name + str(x) + "png")
    

提交回复
热议问题