Leanify is a lightweight lossless file minifier/optimizer. It removes unnecessary data (debug information, comments, metadata, etc.) and recompress the file to reduce file size. It will not reduce image quality at all.
- Support recursive minifying. (e.g. aPNGinside anAPKinside aZIP)
- Support a wide variety offile formats.
- Lightweight, one file, under 1MB, no external dependency.
- Everything is done in memory, no temporary files.
- Cross-Platform, support Windows, Linux, Mac.
- Support traverse directory recursively.
- Ability to identify file format by its data instead of name.
I'm not respossible for any consequence of using Leanify.
PLEASE BACKUP THE FILE BEFORE USING LEANIFY!
It is based onZIP.
Note that modifying files insideAPK
will break digital signature.
To install it, you'll have to sign it again.
If you don't want to modify any files insideAPK
,use-d 1
option.
cbt
is based ontar.cbz
is based onZIP.
Office document 1997-2003 (.doc,.xls,.ppt) is not supported.
Looks fordata:image/*;base64
and leanify base64 encoded embedded image.
It is based onZIP.
It is based onZIP.
It is based onXML.
Leanify embedded images.
It's an image container format found in Tencent QQ.
Leanify the image inside.
Leanify file inside and recompress deflate stream.
Remove all optional section:FEXTRA
,FNAME
,FCOMMENT
,FHCRC
.
Convert 256x256 BMP toPNG.
LeanifyPNGinside, if any.
It is based onZIP.
Remove all application markers (e.g.Exif
(use--keep-exif
to keep it),ICC profile
,XMP
) and comments.
Optimize withmozjpeg
.
Remove all debugging information:
- Source name
- Line defined and last line defined
- Source line position list
- Local list
- Upvalue list
It is based on OpenDocument andPNG.
Leanify embedded resource.
RemoveRelocation Table
in executable file.
Remove undocumentedRich Header
.
OverlapPE Header
andDOS Header
.
Remove all ancillary chunks except for:
tRNS
:transparent informationfdAT
,fcTL
,acTL
:These chunks are used byAPNG
npTc
:Android 9Patch images (*.9.png)
Optimize withZopfliPNG
.
It is an archive format found in Tencent QQ.
Leanify all files inside.
Leanify embedded images.
Recompress it withLZMA
.
Remove Metadata Tag.
It is based onXML.
Remove metadata.
Shrink spaces in attributes.
Remove empty attributes.
Remove empty text element and container element.
Leanify all files inside.
Remove all comments, unnecessary spaces, tabs, line breaks.
It is based onZIP.
Note that modifying files insidexpi
will break digital signature.
To install it, you'll have to sign it again.
Leanify all files inside and recompress deflate stream usingZopfli.
UseSTORE
method ifDEFLATE
makes file larger.
Remove extra field inLocal file header
.
RemoveData descriptor structure
,write those information toLocal file header
.
Remove extra field and file comment inCentral directory file header
.
Remove comment inEnd of central directory record
.
Usage: leanify [options] paths
-i, --iteration <iteration> More iterations produce better result, but
use more time, default is 15.
-d, --max_depth <max depth> Maximum recursive depth, unlimited by default.
Set to 1 will disable recursive minifying.
-f, --fastmode Fast mode, no recompression.
-q, --quiet No output to stdout.
-v, --verbose Verbose output.
-p, --parallel Distribute all tasks to all CPUs.
--keep-exif Do not remove Exif.
-
Visual Studio 2015+
Use Leanify.vcxproj
-
gcc 5+
build_gcc.bat
ormingw32-make
gcc 5+ or clang 3.6+
make