display palette level

This commit is contained in:
Celogeek 2022-12-31 00:26:55 +01:00
parent 2fbaedc3b9
commit 3e734866e5
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
2 changed files with 31 additions and 32 deletions

View File

@ -77,7 +77,7 @@ The ePub include as a first page:
Usage of go-comic-converter:
-algo string
Algo for RGB to Grayscale: luster, default, mean, luma (default "default")
Algo for RGB to Grayscale: default, mean, luma, luster (default "default")
-author string
Author of the epub (default "GO Comic Converter")
-input string
@ -90,30 +90,30 @@ Usage of go-comic-converter:
Output of the epub (directory or epub): (default [INPUT].epub)
-profile string
Profile to use:
- K1 ( 600x670 ) - Kindle 1
- K11 ( 1072x1448 ) - Kindle 11
- K2 ( 600x670 ) - Kindle 2
- K34 ( 600x800 ) - Kindle Keyboard/Touch
- K578 ( 600x800 ) - Kindle
- KDX ( 824x1000 ) - Kindle DX/DXG
- KPW ( 758x1024 ) - Kindle Paperwhite 1/2
- KV ( 1072x1448 ) - Kindle Paperwhite 3/4/Voyage/Oasis
- KPW5 ( 1236x1648 ) - Kindle Paperwhite 5/Signature Edition
- KO ( 1264x1680 ) - Kindle Oasis 2/3
- KS ( 1860x2480 ) - Kindle Scribe
- KoMT ( 600x800 ) - Kobo Mini/Touch
- KoG ( 768x1024 ) - Kobo Glo
- KoGHD ( 1072x1448 ) - Kobo Glo HD
- KoA ( 758x1024 ) - Kobo Aura
- KoAHD ( 1080x1440 ) - Kobo Aura HD
- KoAH2O ( 1080x1430 ) - Kobo Aura H2O
- KoAO ( 1404x1872 ) - Kobo Aura ONE
- KoN ( 758x1024 ) - Kobo Nia
- KoC ( 1072x1448 ) - Kobo Clara HD/Kobo Clara 2E
- KoL ( 1264x1680 ) - Kobo Libra H2O/Kobo Libra 2
- KoF ( 1440x1920 ) - Kobo Forma
- KoS ( 1440x1920 ) - Kobo Sage
- KoE ( 1404x1872 ) - Kobo Elipsa
- K1 ( 600x670 ) - 4 levels of gray - Kindle 1
- K11 ( 1072x1448 ) - 16 levels of gray - Kindle 11
- K2 ( 600x670 ) - 15 levels of gray - Kindle 2
- K34 ( 600x800 ) - 16 levels of gray - Kindle Keyboard/Touch
- K578 ( 600x800 ) - 16 levels of gray - Kindle
- KDX ( 824x1000 ) - 16 levels of gray - Kindle DX/DXG
- KPW ( 758x1024 ) - 16 levels of gray - Kindle Paperwhite 1/2
- KV ( 1072x1448 ) - 16 levels of gray - Kindle Paperwhite 3/4/Voyage/Oasis
- KPW5 ( 1236x1648 ) - 16 levels of gray - Kindle Paperwhite 5/Signature Edition
- KO ( 1264x1680 ) - 16 levels of gray - Kindle Oasis 2/3
- KS ( 1860x2480 ) - 16 levels of gray - Kindle Scribe
- KoMT ( 600x800 ) - 16 levels of gray - Kobo Mini/Touch
- KoG ( 768x1024 ) - 16 levels of gray - Kobo Glo
- KoGHD ( 1072x1448 ) - 16 levels of gray - Kobo Glo HD
- KoA ( 758x1024 ) - 16 levels of gray - Kobo Aura
- KoAHD ( 1080x1440 ) - 16 levels of gray - Kobo Aura HD
- KoAH2O ( 1080x1430 ) - 16 levels of gray - Kobo Aura H2O
- KoAO ( 1404x1872 ) - 16 levels of gray - Kobo Aura ONE
- KoN ( 758x1024 ) - 16 levels of gray - Kobo Nia
- KoC ( 1072x1448 ) - 16 levels of gray - Kobo Clara HD/Kobo Clara 2E
- KoL ( 1264x1680 ) - 16 levels of gray - Kobo Libra H2O/Kobo Libra 2
- KoF ( 1440x1920 ) - 16 levels of gray - Kobo Forma
- KoS ( 1440x1920 ) - 16 levels of gray - Kobo Sage
- KoE ( 1404x1872 ) - 16 levels of gray - Kobo Elipsa
-quality int
Quality of the image (default 85)
-title string

13
main.go
View File

@ -71,12 +71,13 @@ type Option struct {
func (o *Option) String() string {
var desc string
var width, height int
var width, height, level int
if i, ok := ProfilesIdx[o.Profile]; ok {
profile := Profiles[i]
desc = profile.Description
width = profile.Width
height = profile.Height
level = len(profile.Palette)
}
limitmb := "nolimit"
if o.LimitMb > 0 {
@ -88,7 +89,7 @@ func (o *Option) String() string {
Options:
Input : %s
Output : %s
Profile : %s - %s - %dx%d
Profile : %s - %s - %dx%d - %d levels of gray
Author : %s
Title : %s
Quality : %d
@ -98,10 +99,7 @@ Options:
`,
o.Input,
o.Output,
o.Profile,
desc,
width,
height,
o.Profile, desc, width, height, level,
o.Author,
o.Title,
o.Quality,
@ -115,9 +113,10 @@ func main() {
availableProfiles := make([]string, 0)
for _, p := range Profiles {
availableProfiles = append(availableProfiles, fmt.Sprintf(
" - %-7s ( %9s ) - %s",
" - %-7s ( %9s ) - %2d levels of gray - %s",
p.Code,
fmt.Sprintf("%dx%d", p.Width, p.Height),
len(p.Palette),
p.Description,
))
}