# 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.
# 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) and
[gflags](https://github.com/gflags/gflags). 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 libgflags-dev`.
* On Arch Linux, do `pacman -S libpng gflags`.
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` and `gflags` using vcpkg: `.\vcpkg install libpng gflags`.
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` and `gflags`
* Using [Homebrew](https://brew.sh/): `brew install libpng gflags`.
* Using [MacPorts](https://www.macports.org/): `port install libpng gflags` (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.
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 (e.g. that haven't
been already compressed with other JPEG encoders). 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 encoder_guetzli-master.zip (73个子文件)
guetzli-master
guetzli.sln 1KB
.gitignore 174B
guetzli
jpeg_data_writer.cc 18KB
color_transform.h 15KB
processor.h 2KB
fast_log.h 1005B
quality.h 775B
gamma_correct.cc 1KB
guetzli.cc 7KB
jpeg_data_reader.h 2KB
stats.h 1KB
fdct.h 994B
order.inc 4KB
jpeg_bit_writer.h 3KB
jpeg_data_encoder.h 1KB
jpeg_huffman_decode.cc 4KB
dct_double.cc 3KB
entropy_encode.h 2KB
jpeg_data.h 6KB
jpeg_data.cc 3KB
quantize.cc 973B
preprocess_downsample.cc 15KB
jpeg_huffman_decode.h 2KB
fdct.cc 8KB
quantize.h 1KB
output_image.h 5KB
jpeg_data_decoder.h 1KB
quality.cc 2KB
comparator.h 4KB
butteraugli_comparator.cc 8KB
idct.cc 4KB
jpeg_data_decoder.cc 2KB
jpeg_data_writer.h 3KB
debug_print.cc 891B
jpeg_error.h 2KB
butteraugli_comparator.h 2KB
output_image.cc 17KB
processor.cc 31KB
score.cc 1KB
entropy_encode.cc 5KB
jpeg_data_reader.cc 35KB
jpeg_data_encoder.cc 4KB
dct_double.h 1KB
idct.h 973B
preprocess_downsample.h 1KB
gamma_correct.h 778B
score.h 837B
debug_print.h 2KB
README.md 4KB
guetzli.vcxproj.filters 5KB
LICENSE 11KB
premake5.lua 1KB
guetzli.make 7KB
guetzli.vcxproj 11KB
third_party
butteraugli
README.md 3KB
butteraugli
butteraugli_main.cc 14KB
butteraugli.h 20KB
butteraugli.cc 50KB
Makefile 169B
LICENSE 11KB
png.BUILD 661B
BUILD 548B
zlib.BUILD 721B
jpeg.BUILD 2KB
WORKSPACE 749B
CONTRIBUTING.md 2KB
png.BUILD 661B
BUILD 678B
zlib.BUILD 721B
tools
guetzli-compare.py 1KB
WORKSPACE 899B
snapcraft.yaml 584B
Makefile 863B
共 73 条
- 1
资源评论
cmengwei
- 粉丝: 55
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功