-
-
Notifications
You must be signed in to change notification settings - Fork 484
/
pngquant.1
129 lines (129 loc) · 3.59 KB
/
pngquant.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
.Dd 2013-02-25
.Dt pngquant 1
.Sh NAME
.Nm pngquant
.Nd PNG converter and lossy image compressor
.Sh SYNOPSIS
.Nm
.Aq options
.Op ncolors
.Pa file
.Op Ar
.Nm
.Aq options
.Op ncolors
.Fl
.Cm < Ns Pa file
.Cm > Ns Pa file
.Sh DESCRIPTION
.Nm
converts 32-bit RGBA PNGs to 8-bit (or smaller) RGBA-palette PNGs, optionally using Floyd-Steinberg dithering.
The output filename is the same as the input name except that it ends in
.Ql -fs8.png
or
.Ql -or8.png
(unless the input is stdin, in which case the quantized image will go to stdout).
The default behavior if the output file exists is to skip the conversion; use
.Fl Fl force
to overwrite.
.Sh OPTIONS
.Bl -tag -width -indent
.It Fl o Ar out.png , Fl Fl output Ar out.png
Writes converted file to the given path. When this option is used only single input file is allowed.
.It Fl Fl ext Ar new.png
File extension (suffix) to use for output files instead of the default
.Ql -fs8.png
or
.Ql -or8.png .
.It Fl f , Fl Fl force
Overwrite existing output files.
.Do
.Fl Fl ext
.Ar .png
.Fl Fl force
.Dc
can be used to convert files in place (which is unsafe).
.It Fl Fl nofs , Fl Fl ordered
Disable Floyd-Steinberg dithering.
.It Fl Fl floyd Op Ar =N
Set dithering level using fractional number between
.Cm 0
(none) and
.Cm 1
(full, the default).
.It Fl s Ar N , Fl Fl speed Ar N
.Cm 1
(brute-force) to
.Cm 11
(fastest). The default is
.Cm 3 .
Speed
.Cm 10
has 5% lower quality, but is about 8 times faster than the default. Speed 11 disables dithering and lowers compression level.
.It Fl Q Ar min-max , Fl Fl quality Ar min-max
.Va min
and
.Va max
are numbers in range
.Cm 0
(worst) to
.Cm 100
(perfect), similar to JPEG.
.Nm
will use the least amount of colors required to meet or exceed the
.Va max
quality. If conversion results in quality below the
.Va min
quality the image won't be saved (or if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code
.Er 99 .
.It Fl Fl skip-if-larger
If conversion results in a file larger than the original, the image won't be saved and pngquant will exit with status code
.Er 98 .
Additionally, file size gain must be greater than the amount of quality lost. If quality drops by 50%, it will expect 50% file size reduction to consider it worthwhile.
.It Fl Fl posterize Ar bits
Truncate number of least significant bits of color (per channel). Use this when image will be output on low-depth displays (e.g. 16-bit RGB).
.Nm
will make almost-opaque pixels fully opaque and will reduce amount of semi-transparent colors. When this option is enabled the default filename suffix is
.Ql -ie-fs8.png
/
.Ql -ie-or8.png .
.It Fl Fl strip
Remove optional chunks (metadata) from PNG files.
.It Fl Fl transbug
Workaround for readers that expect fully transparent color to be the last entry in the palette.
.It Fl v , Fl Fl verbose
Enable verbose messages showing progress and information about input/output. Opposite is
.Fl Fl quiet .
Errors are output to
.Pa stderr
regardless of this option.
.It Fl V , Fl Fl version
Display version on
.Pa stdout
and exit.
.It Fl h , Fl Fl help
Display help and exit.
.El
.Sh EXAMPLE
Creating a new image with the number of colors reduced to 64:
.Bd -ragged -offset indent
.Nm
.Cm 64 image.png
.Ed
.Pp
The resulting image will have 64 colors and will be saved as
.Pa image-fs8.png .
.Pp
Overwriting image in-place if it can be reduced without too much quality loss:
.Bd -ragged -offset indent
.Nm
.Cm -f --ext .png --quality 70-95 image.png
.Ed
.Sh AUTHOR
.Nm
is developed by Kornel Lesinski
.Aq Mt [email protected]
based on code by Greg Roelofs
.Aq Mt [email protected] .
.Pp
.Lk https://pngquant.org "pngquant homepage" .