问题标签 [pillow]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - Pillow 无法读取不同的 TIFF 文件
我在 Ubuntu Server 12.04 64 位上使用 Pillow 2.2.1(使用 pip 安装)并尝试将图像批量调整为 jpeg 格式。我还使用 apt-get 安装了 zlib1g-dev 和 libtiff-dev。
我使用以下行
打开图像文件(jpeg 和 tiff)。我可以打开一些 tiff 图像,但对于其他图像,我只会收到以下错误:
由于我尝试打开的每个 tiff 图像都不会发生这种情况,这是否意味着这些文件已损坏?我可以使用 Windows 照片查看器甚至 GIMP 打开有问题的图像。
注意:所有图像都是我的客户给我的,所以我不知道他是如何将图像数字化的(扫描或拍照是我最好的猜测),或者这是否重要。
我是否缺少包或依赖项,或者真的只是我没有看到的图像文件的某些内容?
python - 使用图像识别创建独立项目
我似乎找不到一种方法来创建一个独立的图像识别包。我有一个我正在用 python 编写的项目,我找到了一种方法来做我需要的事情OpenCV
,但是我找不到将库导入我的项目的方法,除非它安装在 Ubuntu 的系统级别。换句话说,在构建库build
之后,我似乎无法将文件夹放入我的项目中。OpenCV
而且我找不到cv2.matchTemplate()
in PIL
or的等价物Pillow
。所以这里真的有两个问题。
1)如何将build
文件夹附加到我的项目,以避免OpenCV
在系统级别安装。
2) 是否有cv2.matchTemplate()
inPIL
或Pillow
我似乎找不到的等价物?
谢谢。
python - 安装枕头和 PIL
我安装了Ubuntu 12.04 (Precise Pangolin) 并安装了一些软件包,PIL。现在我想使用 Pillow,但是不能和 PIL 同时安装。
我查看了 virtualenv,但还有其他我不想安装的软件包。
有没有另一种方法可以在没有冲突的情况下进行设置?
python - Why does PIL fail to merge 2 images in my code?
I am trying to combine 2 images into a larger one with Image.paste function. I start by creating an image that can hold both images, and then paste in the 2 images:
Then I get this error every time:
I am very sure that the sizes of the images are correct, and the wrapper image can hold both images. The only way to avoid this error is to make the 3 images (wrapper and 2 components) same size, and paste from (0,0).
I am at my wits' end, please help!
python - 保存到 django imagefield
我试着
1) 拍一张上传的图片,用枕头把它变成黑白的
2) 在视图中将原始文件保存到名为“file”的 FileField
3)在视图中将黑白版本保存到名为“thumbnail_225”的 ImageField
1 和 2 效果很好,但我似乎无法弄清楚 #3。
非常感谢任何反馈。
看法
模型
python - Pyinstaller 与 Pillow 相关的问题
我正在尝试在 OSX Mavericks 上使用 pyinstaller,其中一个是 Python 脚本。Pyinstaller 编译并打包,直到它发现 Pillow 库有错误。
看起来 Pyinstaller 和 Pillow 相处得并不融洽(这似乎是一个众所周知的事实:http ://www.pyinstaller.org/ticket/745 )。有办法解决吗?我应该尝试卸载 Pillow 并改为安装 Pil(我选择 Pillow 是因为 Pil 不愿意安装在 Mavericks 上,一开始是因为气馁)?或者可能将 libjpeg.8.dylib 更新到 13.0.0 版本,因为这似乎是问题所在?
[编辑] 感谢@mimi.vx 的建议,我已经更新了 libjepeg 我现在在过程的最后有另一个错误:
我尝试重新安装 Pillow,这样 Pyinstaller 可能会得到目录,但还没有运气......
[重新编辑] 使用 py2app 而不是 pyinstaller 对我有用!
python-3.x - 关于 virtualenv python 3 安装问题的枕头
当我尝试在我的 virtualenv 中安装 Pillow 时,出现以下错误:
什么可能导致问题?我在 virtualenv 中单独安装 PIL 也有问题:
但似乎没有 virtualenv 来源,PIL 安装正常。
macos - 在 Mac OS X 上安装 Pillow 时缺少标头 tiffio.h
尝试使用 PIP 安装 Pillow 时,我收到此包含错误:
有谁知道如何解决这个问题?我在 OS X 10.9 上,以前能够在这台计算机上构建 Pillow。
更新:请注意,我tiffio.h
的机器上有/usr/local/include/tiffio.h
. 将该目录设置为 C 包含路径后,我能够成功编译 Pillow。
这是应该如何完成的,还是我的机器或安装包有问题?
python - 在 Windows 上安装 Pillow for Python
我对 Python 相当陌生,并试图在 Windows 7 上安装 Pillow 包。我从这里下载并运行了 MS Windows 安装程序 Pillow-2.2.1.win-amd64-py3.3.exe 。它似乎安装得很好。如果我运行简单的代码行:
直接来自 Python 解释器,它运行良好。PIL 上的 help() 给了我包的内容。
但是当我尝试从脚本中运行同一行代码时,我得到一个ImportError: No module named PIL
. 我错过了什么?
(请注意,我已经能够在脚本中import sys
进行import MySQLdb
往返操作了。)
已解决:当然,我在运行脚本时正在运行 Python 2.7。(我想我隐约记得必须安装旧版本才能与 MySQL 交互。)谢谢大家指出我应该检查正在使用的版本。