-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathoxipng.sh
75 lines (69 loc) · 1.76 KB
/
oxipng.sh
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
_patch_table() {
_patch_table_edit_options \
'--filters;*,[`_choice_filter`]' \
'--interlace;[`_choice_interlace`]' \
'--keep;*,[`_choice_chunk_name`]' \
'--opt;[`_choice_opt`]' \
'--strip;*,[`_choice_strip`]' \
}
_choice_opt() {
cat <<-'EOF'
0 --zc 5 --fast (1 trial, determined heuristically)
1 --zc 10 --fast (1 trial, determined heuristically)
2 --zc 11 -f 0,1,6,7 --fast (4 fast trials, 1 main trial)
3 --zc 11 -f 0,7,8,9 (4 trials)
4 --zc 12 -f 0,7,8,9 (4 trials)
5 --zc 12 -f 0,1,2,5,6,7,8,9 (8 trials)
6 --zc 12 -f 0-9 (10 trials)
max (stable alias for the max level)
EOF
}
_choice_strip() {
cat <<-'EOF'
safe Strip all non-critical chunks, except for the following: cICP, iCCP, sRGB, pHYs, acTL, fcTL, fdAT
all Strip all non-critical chunks
EOF
_choice_chunk_name
}
_choice_chunk_name() {
cat <<-'EOF'
IHDR Image Header
PLTE Palette
IDAT Image Data
IEND Image End
bKGD Background Color
cHRM Primary Chromaticities
gAMA Image Gamma
hIST Image Histogram
iCCP ICC Profile
iTXt International Text
pHYs Physical Pixel Dimensions
sBIT Significant Bits
sRGB Standard RGB Color Space
tEXt Text
tIME Image Last-Modification Time
tRNS Transparency
zTXt Compressed Text
EOF
}
_choice_interlace() {
cat <<-'EOF'
0 Remove interlacing from all images that are processed
1 Apply Adam7 interlacing on all images that are processed
keep Keep the existing interlacing type of each image
EOF
}
_choice_filter() {
cat <<-'EOF'
0 None (recommended to always include this filter)
1 Sub
2 Up
3 Average
4 Paeth
5 MinSum Minimum sum of absolute differences
6 Entropy Highest Shannon entropy
7 Bigrams Lowest count of distinct bigrams
8 BigEnt Highest Shannon entropy of bigrams
9 Brute Smallest compressed size (slow)
EOF
}