跳转到主要内容

自动无损图像压缩

项目描述

哦?

这是一个用Python编写的简单脚本,用于压缩图像。通常,图像并不像它们可能的那样小。

Smooshy.py通过允许您在不涉及Save for Web Photoshop对话框中常规混乱的情况下压缩所有那些讨厌的多余字节来解决这个问题。

如何做到这一点?

实际上,Smooshy基本上只是一个利用了惊人的[smush.it](http://smush.it/)脚本的脚本——所有您的图像都会发送到smush.it进行压缩——所以[请注意您不要发送您想要极度保密的内容](http://smush.it/faq.php)。

一切都是安全的

Smooshy在为您的图像施加其小精灵魔力时,会为您创建所有文件的备份。如果发生错误,您的原始文件不会消失在黑洞中。

此外,如果压缩后的文件不比原始文件小,则不会使用该文件。

需求

使用

当前目录

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 (5.5 kB 查看哈希值)

上传时间 源码

由以下提供支持