precomp-cpp

schnaaderApache-2.0长期未更新

对已压缩文件(JPG、GIF、MP3、PDF 等)做二次无损压缩的命令行工具,能进一步缩小体积。

Precomp, C++ version - further compress already compressed files

v0.4.7发布于 2019-02-22 14:24 UTC467star59fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
precomp silesia.zip
硬件要求按 README 说明

README 未说明硬件要求,仅提供 Windows 和 Linux 的官方二进制与源码构建方式

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

命令行预压缩工具,能把已压缩文件再压小一圈,适合做归档和极限压缩

对已压缩文件(JPG、GIF、MP3、PDF 等)做二次无损压缩的命令行工具,能进一步缩小体积。

核心能力

  • 解压 Deflate/zLib 流并验证可比特级还原后再重新压缩
  • 支持 PDF、PNG、ZIP、GIF、JPG、MP3、bZip2 等格式
  • 输出 LZMA2 压缩的 .pcf 文件,或用 -cn 输出可交给更强压缩器的数据
  • 用 -r 参数从 .pcf 还原出与原文件比特一致的结果
  • Windows 与 Linux/macOS 版本生成的 PCF 文件可互换

容易踩的坑

还原时加 -o 指定输出名,否则会直接覆盖同名原文件;-cn 模式产出的文件比原文件更大,需再交给 LZMA2 等更强算法压缩才有收益;JPG/MP3 处理依赖内置的 brunsli、packJPG、packMP3 等第三方库,自行编译时需一并构建

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

4 个版本v0.4.7
  1. v0.4.7最新正式版2019-02-22 · 2019-02-22 14:24 UTC
  2. v0.4.62017-09-08 · 2017-09-08 05:10 UTC
    查看更新说明
    • Using liblzma for on-the-fly compression (-cl) - thanks to sftt
    • Reduced temporary files usage
    • Much faster intense and brute mode
    • Intense and brute mode can be combined now for best results
    • Smoother progress indicator, second progress indicator in lzma mode
    • Flag -e to preserve file extension (file.ext => file.ext.pcf instead of file.pcf) - thanks to guptaprince
    • JPG detection faster and more reliable - thanks to Márcio Pais
    • Updated zlib to 1.2.11
    • Show Precomp version together with OS type (Linux/Windows) and 32/64 bit information
    • Fixed crashes on certain files (Issue #52, Issue #59)
    • Fixed incorrect restoration of a PNG multi file (Issue #50)
  3. v0.4.52016-05-08 · 2016-05-08 09:23 UTC
    查看更新说明
    • Updated packJPG to 2.5k, packMP3 to 1.0g (Issue #33)
    • Windows version compiled using GCC/G++ 5.3.0 (before: 4.8.1)
    • 32-bit and 64-bit versions (~10-20% faster on 64-bit machines)
    • SWF support adjusted to newer versions (Issue #31)
    • MP3 support (Issue #18)
    • MP3 and JPG recompression without temporary files for sizes up to 64 MB (also see Issue #14)
    • Fixed memory corruption in packJPG that led to crashes (Issue #17)
    • Fixed Base64 streams not being restored correctly in recursion (Issue #36)
    • Also see closed issue list
  4. v0.4.42016-01-24 · 2016-01-24 14:07 UTC
    查看更新说明
    • First open source release
    • Updated libraries (packJPG, zLib, bZip2)
    • Conversion switch -n reports filesize now

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Precomp

    Join the chat at https://gitter.im/schnaader/precomp-cpp Build Status Build status

    Packaging status

    What is Precomp?

    Precomp is a command line precompressor that can be used to further compress files that are already compressed. It improves compression on some file-/streamtypes - works on files and streams that are compressed with zLib or the Deflate compression method (like PDF, PNG, ZIP and many more), bZip2, GIF, JPG and MP3. Precomp tries to decompress the streams, and if they can be decompressed and "re-"compressed so that they are bit-to-bit-identical with the original stream, the decompressed stream can be used instead of the compressed one.

    The result of Precomp is either a smaller, LZMA2 compressed file with extension .pcf (PCF = PreCompressedFile) or, when using -cn, a file containing decompressed data from the original file together with reconstruction data. In this case, the file is larger than the original file, but can be compressed with any compression algorithm stronger than Deflate to get better compression.

    Since version 0.4.3, Precomp is available for Linux/*nix/macOS, too. The different versions are completely compatible, PCF files are exchangeable between Windows/Linux/*nix/macOS systems.

    Usage example

    CommandComment
    wget http://mattmahoney.net/dc/silesia.zip (or download from here)We want to compress this file (the Silesia compression corpus). Size: 67,633,896 bytes (100,0%)
    7z a -mx=9 silesia.7z silesia.zipCompressing with 7-Zip LZMA2, setting "Ultra". Size: 67,405,052 bytes (99,7%)
    precomp silesia.zipCompressing with Precomp results in silesia.pcf. Size: 47,122,779 bytes (69,7%)
    precomp -r -osilesia.zip_ silesia.pcfThis restores the original file to a new file named silesia.zip_. Without the -o parameter, Precomp would decompress to silesia.zip.
    diff -s silesia.zip silesia.zip_Compares the original file to the result file, they're identical

    How can I contribute?

    • You can have a look at the Issue list
    • You can build the project or download the binaries (see below), run it on your system and report bugs or make enhancement proposals.

    Releases/Binaries

    Official GitHub releases for both Windows and Linux.

    Alternative binary download of the latest official release for both Windows and Linux.

    Binaries for older version can be found at this Google Drive folder.

    Contact

    Christian Schneider

    [email protected]

    http://schnaader.info

    Donations

    Donate

    To donate, you can either use the donate button here, the one at the top of the page ("Sponsor") or the one on my homepage. You can also send bitcoins to

    1KvQxn6KHp4tv92Z5Fy8dTPLz4XdosQpbz
    

    Credits

    Thanks for support, help and comments:

    Legal stuff

    License

    Copyright 2006-2021 Christian Schneider

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.