-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpngnq.1
81 lines (73 loc) · 2.7 KB
/
pngnq.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
\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.TH PNGNQ 1 "MAY 2009" Linux "User Manuals"
.SH NAME
pngnq \- quantize png images
.SH SYNOPSIS
.B pngnq [-vfhV][-s
.I sample_factor
.B ][-Q
.I dither
.B ][-g
.I gamma
.B ][-e
.I extension
.B ][-d
.I dir
.B ][-n
.I colors
.B ][
.I inputfiles
.B ]
.SH DESCRIPTION
.B pngnq
quantizes a 32-bit RGBA PNG image to an 8 bit RGBA palette PNG
using the neuquant algorithm. The output file name is the
input file name extended with "\-nq8.png" or a specified extension.
The "input files" defaults to standard input if not specified. If
standard input is being processed the output is sent to standard
output.
.SH OPTIONS
.IP "-d dir"
Tells pngnq to put output files in a directory other than the one the input files
are in.
.IP "-e extension"
Specifies the new filename extension. Defaults to "\-nq8.png".
Pngnq drops .png from the original filenames. If you set the argument of the \-e option
to .png and choose the \-f option the input file will be overwritten.
.IP -f
Force overwriting of files.
.IP "-g gamma"
Set the image gamma correction. If not present, uses the png file's gamma or defaults to 1.0.
.IP -h
Print program help.
.IP "-n colors"
Specifies the number of colors to quantize to. Defaults to 256 which is the maximum.
The minimum here is 2.
.IP "-Q dither"
Choose a dithering method: n = no dither (default), f = Floyd Steinberg dithering.
.IP "-s sample factor"
Sample factor. The neuquant algorithm samples pixels stepping by this value.
The default value of 3 gives good results. Higher values sample less
of the image pixels and thus are faster but less accurate. A factor of 1 samples
every image pixel.
.IP -v
Verbose mode. Prints status messages.
.IP -V
Print version number and library versions.
.SH USAGE NOTES
Pngnq works best when quantizing to a fairly large number of colors (>=64).
This mainly a result of the visible edges due to the lack of dithering.
The amount of compression of images gained is determined largely by the level of quantization.
Using a tool like pngcrush (http://pmt.sourceforge.net/pngcrush/) to further process these images results in slightly smaller images than with methods that dither the image. This is probably due to the lack of high frequency data in the non-dithered images.
To quantize and compress an image, for example image.png,
with the compressed output as smallimage.png, I do this:
.I pngnq -n 256 image.png && pngcrush image-nq8.png smallimage.png
This usually results in a greater than 50% compression with a small loss of detail.
.SH BUGS
Does not deal correctly with greyscale alpha images with low bit depths, but these won't benefit from quantizing.
.SH AUTHOR
Stuart Coyle <[email protected]>
.SH "SEE ALSO"
.BR png(5)