<p align="center"><img src="https://cloud.githubusercontent.com/assets/203457/24553916/1f3f88b6-162c-11e7-990a-731b2560f15c.png" alt="Guetzli" width="64"></p>
# Introduction
Guetzli is a JPEG encoder that aims for excellent compression density at high
visual quality. Guetzli-generated images are typically 20-30% smaller than
images of equivalent quality generated by libjpeg. Guetzli generates only
sequential (nonprogressive) JPEGs due to faster decompression speeds they offer.
[![Build Status](https://travis-ci.org/google/guetzli.svg?branch=master)](https://travis-ci.org/google/guetzli)
# Building
## On POSIX systems
1. Get a copy of the source code, either by cloning this repository, or by
downloading an
[archive](https://github.com/google/guetzli/archive/master.zip) and
unpacking it.
2. Install [libpng](http://www.libpng.org/pub/png/libpng.html).
If using your operating system
package manager, install development versions of the packages if the
distinction exists.
* On Ubuntu, do `apt-get install libpng-dev`.
* On Fedora, do `dnf install libpng-devel`.
* On Arch Linux, do `pacman -S libpng`.
* On Alpine Linux, do `apk add libpng-dev`.
3. Run `make` and expect the binary to be created in `bin/Release/guetzli`.
## On Windows
1. Get a copy of the source code, either by cloning this repository, or by
downloading an
[archive](https://github.com/google/guetzli/archive/master.zip) and
unpacking it.
2. Install [Visual Studio 2015](https://www.visualstudio.com) and
[vcpkg](https://github.com/Microsoft/vcpkg)
3. Install `libpng` using vcpkg: `.\vcpkg install libpng`.
4. Cause the installed packages to be available system-wide: `.\vcpkg integrate
install`. If you prefer not to do this, refer to [vcpkg's
documentation](https://github.com/Microsoft/vcpkg/blob/master/docs/EXAMPLES.md#example-1-2).
5. Open the Visual Studio project enclosed in the repository and build it.
## On macOS
To install using [Homebrew](https://brew.sh/):
1. Install [Homebrew](https://brew.sh/)
2. `brew install guetzli`
To install using the repository:
1. Get a copy of the source code, either by cloning this repository, or by
downloading an
[archive](https://github.com/google/guetzli/archive/master.zip) and
unpacking it.
2. Install [Homebrew](https://brew.sh/) or [MacPorts](https://www.macports.org/)
3. Install `libpng`
* Using [Homebrew](https://brew.sh/): `brew install libpng`.
* Using [MacPorts](https://www.macports.org/): `port install libpng` (You may need to use `sudo`).
4. Run the following command to build the binary in `bin/Release/guetzli`.
* If you installed using [Homebrew](https://brew.sh/) simply use `make`
* If you installed using [MacPorts](https://www.macports.org/) use `CFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' make`
## With Bazel
There's also a [Bazel](https://bazel.build) build configuration provided. If you
have Bazel installed, you can also compile Guetzli by running `bazel build -c opt //:guetzli`.
# Using
**Note:** Guetzli uses a large amount of memory. You should provide 300MB of
memory per 1MPix of the input image.
**Note:** Guetzli uses a significant amount of CPU time. You should count on
using about 1 minute of CPU per 1 MPix of input image.
**Note:** Guetzli assumes that input is in **sRGB profile** with a **gamma of
2.2**. Guetzli will ignore any color-profile metadata in the image.
To try out Guetzli you need to [build](#building) or
[download](https://github.com/google/guetzli/releases) the Guetzli binary. The
binary reads a PNG or JPEG image and creates an optimized JPEG image:
```bash
guetzli [--quality Q] [--verbose] original.png output.jpg
guetzli [--quality Q] [--verbose] original.jpg output.jpg
```
Note that Guetzli is designed to work on high quality images. You should always
prefer providing uncompressed input images (e.g. that haven't been already
compressed with any JPEG encoders, including Guetzli). While it will work on other
images too, results will be poorer. You can try compressing an enclosed [sample
high quality
image](https://github.com/google/guetzli/releases/download/v0/bees.png).
You can pass a `--quality Q` parameter to set quality in units equivalent to
libjpeg quality. You can also pass a `--verbose` flag to see a trace of encoding
attempts made.
Please note that JPEG images do not support alpha channel (transparency). If the
input is a PNG with an alpha channel, it will be overlaid on black background
before encoding.
没有合适的资源?快使用搜索试试~ 我知道了~
JPEG图像压缩(C++源码)
共86个文件
h:26个
cc:23个
build:7个
需积分: 1 0 下载量 93 浏览量
2024-05-20
17:21:25
上传
评论
收藏 320KB ZIP 举报
温馨提示
Guetzli 是一种 JPEG 编码器,旨在实现高视觉质量和出色的压缩密度。 视觉质量。Guetzli 生成的图像通常比 libjpeg 生成的同等质量的图像小 20-30%。 同等质量的图像小 20-30%。Guetzli 只生成 由于解压缩速度更快,Guetzli 只生成顺序(非渐进)JPEG。
资源推荐
资源详情
资源评论
收起资源包目录
JPEG图像压缩.zip (86个子文件)
guetzli_static.make 7KB
tools
guetzli-compare.py 1KB
guetzli.vcxproj 11KB
.travis.yml 809B
WORKSPACE 740B
Makefile 1KB
LICENSE 11KB
tests
golden_test.sh 1KB
bees.png 173KB
png_checksums.txt 2KB
smoke_test.sh 1KB
golden_checksums.txt 11KB
CONTRIBUTING.md 2KB
.travis.sh 973B
snapcraft.yaml 584B
guetzli.vcxproj.filters 5KB
guetzli.sln 2KB
guetzli.make 7KB
fuzz_target.cc 829B
.gitignore 174B
guetzli.svg 643B
premake5.lua 1KB
guetzli_static.vcxproj.filters 5KB
appveyor.yml 1013B
third_party
butteraugli
WORKSPACE 759B
jpeg.BUILD 2KB
butteraugli
butteraugli.h 22KB
Makefile 169B
butteraugli_main.cc 14KB
butteraugli.cc 58KB
LICENSE 11KB
zlib.BUILD 721B
png.BUILD 661B
BUILD 548B
README.md 3KB
BUILD 505B
guetzli_static.vcxproj 10KB
external
zlib.BUILD 721B
png.BUILD 661B
README.md 4KB
guetzli
butteraugli_comparator.cc 16KB
quality.cc 2KB
jpeg_data.cc 3KB
quantize.h 1KB
jpeg_data_writer.cc 18KB
entropy_encode.cc 5KB
jpeg_huffman_decode.h 2KB
processor.cc 33KB
score.h 837B
debug_print.h 2KB
preprocess_downsample.cc 15KB
entropy_encode.h 2KB
jpeg_data_encoder.h 1KB
guetzli.cc 10KB
dct_double.cc 3KB
gamma_correct.cc 1KB
quality.h 775B
fdct.h 994B
jpeg_data_decoder.cc 2KB
jpeg_data_reader.cc 35KB
butteraugli_comparator.h 3KB
jpeg_data_reader.h 2KB
comparator.h 4KB
idct.cc 4KB
idct.h 973B
fdct.cc 8KB
order.inc 4KB
gamma_correct.h 778B
output_image.h 5KB
jpeg_huffman_decode.cc 4KB
processor.h 2KB
stats.h 1KB
jpeg_data.h 6KB
dct_double.h 1KB
color_transform.h 15KB
fast_log.h 1005B
preprocess_downsample.h 1KB
quantize.cc 973B
jpeg_bit_writer.h 3KB
score.cc 1KB
jpeg_data_writer.h 3KB
jpeg_error.h 2KB
debug_print.cc 891B
jpeg_data_decoder.h 1KB
output_image.cc 17KB
jpeg_data_encoder.cc 4KB
共 86 条
- 1
资源评论
没有黑科技
- 粉丝: 384
- 资源: 119
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功