python + PIL
#coding=utf-8
import PIL
from PIL import Image
import time
start = time.time()
im = Image.open("sample.jpg")
im1 = im.resize((100,100), Image.ANTIALIAS)
im1.save( '/tmp/sample_py.jpg')
print time.time() - start
引用
python2.7 pil.py
0.0170481204987
python2.7 pil.py
0.0169599056244
PHP + GD
<?PHP
$start = microtime();
$image = imagecreatefromjpeg('sample.jpg');
$image_p = imagecreatetruecolor(100,100);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 100, 100, imagesx($image), imagesy($image));
imagejpeg( $image_p ,'/tmp/sample_php.jpg',80);
print_r( microtime() - $start );
引用
0.009451
0.009427
分享到:
相关推荐
课程设计、毕业设计以及练手的优质python小项目--图片批量处理器 课程设计、毕业设计以及练手的优质python小项目--图片批量处理器 课程设计、毕业设计以及练手的优质python小项目--图片批量处理器 课程设计、毕业...
原来是通过命令行下载的docx安装包还没有完全兼容python3,估计这个安装包还只兼容python 2(python2 和python3差别还是挺大的,虽然现在python 3出来很久了,但是不少三方库还没有更新),因此需要自己找一个兼容的包...
OpenCV-Python-Toturial-中文版.pdf
python-urlgrabber-3.9.1-11.el6.noarch.rpm
python-2.7.5-90.el7.x86_64.rpm
python-3.7.3-amd64.exe Python 3.7.3 for Windows x64位 or 32位 Windows x86-64 executable installer MD5: a2b79563476e9aa47f11899a53349383 File Size: 26190920 请不要给我5星好评,因为好评会上涨下载积分!
Python 自动办公- excel处理实例(单工作簿拆分到多工作簿中(多表中)Python源码Python 自动办公- excel处理实例(单工作簿拆分到多工作簿中(多表中)Python源码Python 自动办公- excel处理实例(单工作簿拆分到多...
Python自动办公- excel处理实例(单工作簿拆分到多工作簿中(单表中))Python源码Python自动办公- excel处理实例(单工作簿拆分到多工作簿中(单表中))Python源码Python自动办公- excel处理实例(单工作簿拆分到...
Python实现--- 图片转文字图案
详解python实现FP-TREE进行关联规则挖掘 python3.2实现,可以生成每一步fp树的图片(需要安装PIL)
mysql-connector-python-2.0.4-py3.4
python-3.7.6 windows版 在电脑上写python代码 可以结合visual使用python-3.7.6 windows版 在电脑上写python代码 可以结合visual使用 python-3.7.6 windows版 在电脑上写python代码 可以结合visual使用
Python-100-Days-master python从入门到大师,是GitHub上开源学习项目。比较实用。
python 下的多图像拼接源代码,供学习参考! python 下的多图像拼接源代码,供学习参考! python 下的多图像拼接源代码,供学习参考!
Python学习--异常处理思维导图!!来源于网易云课堂王顺子
python爬虫-----爬取腾讯网上的图片jpg、png并下载到本地
python基础运用-插入图片到excel中
Python-2.7.3-xcompile.patch Python2.7.3 交叉编译所需要的patch
1、使用 python 的 PIL 包,对图片进行压缩; 2、环境为 python 3.7.0、安装 PIL 包: pip install pillow; 3、图片尺寸等比例修改参数 scale【默认0.2】,图片压缩质量参数 quality【默认100】,图片公用命名参数 ...
python-iniparse-0.3.1-2.1.el6.noarch.rpm