求解析psd文件的模块

oxsicn 发布于 2013/09/06 15:39
阅读 2K+
收藏 1

寻求可以解析psd文件的模块

能获取到图层解构

语言不限 最好是py

加载中
0
oxsicn
oxsicn

引用来自“prehisle”的答案

无法保存图像 提示我没有PIL啊

版本:

Python 2.7.5

PIL 1.1.7

psd-tools 0.8.4

import Image
from psd_tools import PSDImage
psd = PSDImage.load('test.psd')
merged_image = psd.as_PIL()
merged_image.save('my_image.png')
运行结果
Traceback (most recent call last):
  File "D:\test\k\psdtest1.py", line 4, in <module>
    merged_image = psd.as_PIL()
  File "D:\Python27\lib\site-packages\psd_tools\user_api\psd_image.py", line 210, in as_PIL
    return pil_support.extract_composite_image(self.decoded_data)
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 62, in extract_composite_image
    get_icc_profile(decoded_data),
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 68, in _channels_data_to_PIL
    raise Exception("This module requires PIL (or Pillow) installed.")
Exception: This module requires PIL (or Pillow) installed.





0
sToa
sToa

引用来自“鑫酱”的答案

引用来自“prehisle”的答案

无法保存图像 提示我没有PIL啊

版本:

Python 2.7.5

PIL 1.1.7

psd-tools 0.8.4

import Image
from psd_tools import PSDImage
psd = PSDImage.load('test.psd')
merged_image = psd.as_PIL()
merged_image.save('my_image.png')
运行结果
Traceback (most recent call last):
  File "D:\test\k\psdtest1.py", line 4, in <module>
    merged_image = psd.as_PIL()
  File "D:\Python27\lib\site-packages\psd_tools\user_api\psd_image.py", line 210, in as_PIL
    return pil_support.extract_composite_image(self.decoded_data)
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 62, in extract_composite_image
    get_icc_profile(decoded_data),
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 68, in _channels_data_to_PIL
    raise Exception("This module requires PIL (or Pillow) installed.")
Exception: This module requires PIL (or Pillow) installed.





pip install Pillow
0
oxsicn
oxsicn

引用来自“prehisle”的答案

引用来自“鑫酱”的答案

引用来自“prehisle”的答案

无法保存图像 提示我没有PIL啊

版本:

Python 2.7.5

PIL 1.1.7

psd-tools 0.8.4

import Image
from psd_tools import PSDImage
psd = PSDImage.load('test.psd')
merged_image = psd.as_PIL()
merged_image.save('my_image.png')
运行结果
Traceback (most recent call last):
  File "D:\test\k\psdtest1.py", line 4, in <module>
    merged_image = psd.as_PIL()
  File "D:\Python27\lib\site-packages\psd_tools\user_api\psd_image.py", line 210, in as_PIL
    return pil_support.extract_composite_image(self.decoded_data)
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 62, in extract_composite_image
    get_icc_profile(decoded_data),
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 68, in _channels_data_to_PIL
    raise Exception("This module requires PIL (or Pillow) installed.")
Exception: This module requires PIL (or Pillow) installed.





pip install Pillow

Pillow也安装了 一样 py我刚开始研究 会不会用法不对 比如要引入某个库?

C:\Windows\system32>pip list
-curses (2.2)
docopt (0.6.1)
guidata (1.6.1)
guiqwt (2.3.1)
MySQL-python (1.2.4)
packbits (0.6)
PIL (1.1.7)
Pillow (2.1.0)
pip (1.4.1)
psd-tools (0.8.4)
psdparser (0.1)
pymaging (0.1)
pymssql (2.0.0b1)
setuptools (0.6c11)


0
tsl0922
lao_peii
lao_peii
哈哈,这是我大学老师写的
0
oxsicn
oxsicn

引用来自“鑫酱”的答案

引用来自“prehisle”的答案

引用来自“鑫酱”的答案

引用来自“prehisle”的答案

无法保存图像 提示我没有PIL啊

版本:

Python 2.7.5

PIL 1.1.7

psd-tools 0.8.4

import Image
from psd_tools import PSDImage
psd = PSDImage.load('test.psd')
merged_image = psd.as_PIL()
merged_image.save('my_image.png')
运行结果
Traceback (most recent call last):
  File "D:\test\k\psdtest1.py", line 4, in <module>
    merged_image = psd.as_PIL()
  File "D:\Python27\lib\site-packages\psd_tools\user_api\psd_image.py", line 210, in as_PIL
    return pil_support.extract_composite_image(self.decoded_data)
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 62, in extract_composite_image
    get_icc_profile(decoded_data),
  File "D:\Python27\lib\site-packages\psd_tools\user_api\pil_support.py", line 68, in _channels_data_to_PIL
    raise Exception("This module requires PIL (or Pillow) installed.")
Exception: This module requires PIL (or Pillow) installed.





pip install Pillow

Pillow也安装了 一样 py我刚开始研究 会不会用法不对 比如要引入某个库?

C:\Windows\system32>pip list
-curses (2.2)
docopt (0.6.1)
guidata (1.6.1)
guiqwt (2.3.1)
MySQL-python (1.2.4)
packbits (0.6)
PIL (1.1.7)
Pillow (2.1.0)
pip (1.4.1)
psd-tools (0.8.4)
psdparser (0.1)
pymaging (0.1)
pymssql (2.0.0b1)
setuptools (0.6c11)


问题已解决, PIL库安装时可能出现问题,卸载重装问题解决
返回顶部
顶部