Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
如何将 PIL.ImageTk.PhotoImage 保存为 jpg
我想将 PIL ImageTk PhotoImage 保存到文件中 我的方法是创建一个 打开 文件并调用 写入 方法 但它不起作用 因为我不知道如何从对象获取字节数组 def store temp image data image new
python
pythonimaginglibrary
将 2D Numpy 灰度值数组转换为 PIL 图像
假设我有一个 2D Numpy 数组 其值范围在 0 到 1 之间 它表示灰度图像 然后如何将其转换为 PIL Image 对象 迄今为止的所有尝试都产生了极其奇怪的分散像素或黑色图像 for x in range image shape
python
NumPy
pythonimaginglibrary
如何使用自制程序在系统库中安装PIL?
在新的 SnowLeopard 安装中 我想使用自制程序来安装 PIL 然而 该配方将 PIL 安装在 cellar 下 而不是在 Library Python 2 6 site packages 中 有没有办法改变安装目录 您可以创建一个
pythonimaginglibrary
Homebrew
如何显示有关图像的所有元数据?
我正在尝试使用 Pillow 读取图像的元数据TAGS功能 我使用以下代码来获取此信息 imports from PIL import Image from PIL ExifTags import TAGS imagename image
imageprocessing
pythonimaginglibrary
EXIF
在Python中,如何在图像上写入文本,并在其上覆盖另一个图像?
我需要在 Python 中将一些文本放在 PNG 图像上 我还需要将另一个图像放在第一个图像上 因此 我将有一个基本图像 创建的每个图像都相同 一个放在左上角的徽标以及整个图像上的文本 非特定字体 我只需要设置字体大小 我可以使用 PIL
python
PNG
pythonimaginglibrary
如何将PIL图像传递给python-pptx中的Add_Picture
我正在尝试从剪贴板获取图像 并且想将该图像添加到 python pptx 中 我不想将图像保存在磁盘中 我已经尝试过这个 from pptx import Presentation from PIL import ImageGrab Ima
python
pythonimaginglibrary
pythonpptx
检查包含数十万张图像的目录中损坏的文件的速度逐渐变慢
所以我有 600 000 多张图像 我估计其中大约 5 10 已损坏 我正在生成一个日志 准确记录与该图像相关的图像 使用Python 到目前为止我的方法是这样的 def img validator source files get pat
python
pythonimaginglibrary
将 numpy ndarray 写入图像
我正在尝试在 Python 中读取二进制文件 8 位 RGB 元组 对其进行一些转换 然后将其写入为 png 图像 我正在执行以下操作 typeinfo np dtype gt i1 read single bytes data np fr
python
image
NumPy
pythonimaginglibrary
是否可以使用 PIL 减少图像的深度?
是否可以使用 PIL 减少图像的深度 比如说从常规 8bpp 变为 4bpp 您可以轻松转换图像模式 只需调用im convert newmode 在图像对象上im 它会给你一个新的所需模式的新图像 但没有 4bpp 的模式 列出了支持的模
python
imageprocessing
pythonimaginglibrary
在 PIL 中保存 GIF 时透明度不一致
我正在编写可以覆盖图像并使背景透明的脚本 输出应该是 GIF 格式 该脚本有效 但对于某些图像 透明度未按预期工作 这是脚本 from PIL import Image from PIL import ImageDraw from PIL
python
pythonimaginglibrary
transparency
gif
PIL 图像到 QPixmap 转换问题
今天我一直在努力应对这一挑战 我已经利用之前的帖子和其他资源成功地获得了很好的观点 我正在尝试将 PIL Image 转换为 QPixmap 以便可以在 PyQT GUI 上使用 QgraphicsScene 进行显示 但是当图片显示时颜色
python
pyqt
PyQt4
pythonimaginglibrary
使用 PIL 为高维图像绘制矩形时,draw.rectangle([x1, y1, x2, y2], fill="Black") 中出现错误
当使用 PIL python 库为高维 png 文件 770x1024 绘制矩形时 我在 draw rectangle x1 y1 x2 y2 fill Black 中遇到错误 但它适用于中等尺寸的图像 img Image open Byt
python
python3x
pythonimaginglibrary
redaction
灰度图像到 NumPy 数组进行傅里叶变换
目前我正在使用 PIL 和 NumPy 我有一个彩色的png图像 我想要 以灰度读取 转换为 NumPy 数组 对阵列执行 FFT 显示图像 这就是我正在尝试的 在 IPython w pylab flag In 1 import Imag
python
imageprocessing
NumPy
pythonimaginglibrary
fft
将 PIL 图像转换为字节数组
在 C 中 我可以使用Bitmap lockbits 以字节数组形式访问位图 如何在 PIL 中执行此操作 我努力了Image write 但它将完整格式的图像写入流中 from io import BytesIO from PIL imp
python
pythonimaginglibrary
用颜色填充图像但保留 Alpha(PIL 中的颜色叠加)
基本上 我正在尝试创建一个函数来获取给定的图像和颜色 对于图像中的每个像素 它将保留原始 alpha 值 但会将颜色更改为给定的颜色 例如 如果函数获取下面的箭头图像和红色 它将输出以下图像 在 Photoshop 和其他图像编辑器中 这种
python
python3x
pythonimaginglibrary
如何在Ubuntu 11.04中安装PIL?
我在互联网上看到这个问题 我已经尝试遵循所有这些问题 但我仍然无法让 PIL 工作 我尝试通过以下方式符号链接 zlib jpeg 等库 sudo ln s usr lib x86 64 linux gnu libfreetype so u
python
Ubuntu
pythonimaginglibrary
从 numpy 数组转换为 RGB 图像
我有三个 241 241 numpy 数组 我想将它们视为图像的红色 绿色和蓝色分量 我已经尝试过这个 import numpy as np from PIL import Image arr np zeros len x len z 3
python
NumPy
pythonimaginglibrary
OSError:图像文件被截断
当我处理一堆图像时 其中一个图像出现此错误 File home tensorflowpython firstmodel yololoss py line 153 in data generator image box get random
python
pythonimaginglibrary
我可以用PIL全屏显示图像吗?
如何使用Python图像库全屏显示图像 from PIL import Image img1 Image open colagem3 png img1 show 全屏模式显示 问题的核心 PIL没有全屏打开图像的本机方法 这是有道理的 它不
python
Windows
fullscreen
pythonimaginglibrary
如何在Python中从掩模分割图像创建轮廓(具有可控的厚度)?
这里我有一个分割模型的分割输出图像 我想为这些蒙版创建一个轮廓 然后将该轮廓放在原始图像上 以将图像上的预测区域指示为分割输出 我尝试使用 PIL 过滤器 FIND EDGES 但它为轮廓提供了非常薄的边缘 有什么方法可以将此蒙版图像转换为
python
image
opencv
imageprocessing
pythonimaginglibrary
«
1
2
3
4
5
6
7
...20
»