自动无损图像压缩
项目描述
哦?
这是一个用Python编写的简单脚本,用于压缩图像。通常,图像并不像它们可能的那样小。
Smooshy.py通过允许您在不涉及Save for Web Photoshop对话框中常规混乱的情况下压缩所有那些讨厌的多余字节来解决这个问题。
如何做到这一点?
实际上,Smooshy基本上只是一个利用了惊人的[smush.it](http://smush.it/)脚本的脚本——所有您的图像都会发送到smush.it进行压缩——所以[请注意您不要发送您想要极度保密的内容](http://smush.it/faq.php)。
一切都是安全的
Smooshy在为您的图像施加其小精灵魔力时,会为您创建所有文件的备份。如果发生错误,您的原始文件不会消失在黑洞中。
此外,如果压缩后的文件不比原始文件小,则不会使用该文件。
需求
simplejson - http://pypi.python.org/pypi/simplejson/
Python 2.5 - https://pythonlang.cn/download/releases/2.5/或更高版本(可能不是Python 3)
使用
当前目录
cd <directory of your choice> smooshy .
特定文件/目录
smooshy <as many files or directories as you'd like to smush here>
在Python中
from smooshy import smoosher smoosher.Smoosher(<file path).smoosh() # Smooshes the file smoosher.recursive_smoosher([<file or directory>... ]) # Smooshes all files / all files recursively in directories
安装
使用PIP
从Github
pip install git+git://github.com/josegonzalez/smooshy.git#egg=smooshy
从PyPI
pip install smooshy==1
致谢
很多人
项目详情
关闭
smooshy-1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | bddc7e8695bde4d01ff973896f624ac3dbd3513cf8e25d538a5d07df7d4dbbcd |
|
MD5 | 97ca0464fefd9aac407f32e77e4152ff |
|
BLAKE2b-256 | 7e25e8f0b17e548b0a2100ab4dd4e7c82f57303e9c5af90b9f946c411748bb53 |