4 Commits
Author SHA1 Message Date
Milan Nikolic 38cb375a93 Switch to pure Go JPEG, WEBP, AVIF and JXL codecs 2026-08-17 00:06:19 +02:00
Milan Nikolic 9f6792eaae Update modules 2026-07-06 09:47:28 +02:00
Milan Nikolic 63605a1775 Add screenshot 2026-06-30 22:19:13 +02:00
Milan Nikolic d45a14ecc5 Update modules.txt 2026-06-27 21:49:18 +02:00
26 changed files with 238 additions and 161 deletions
+2 -2
View File
@@ -85,7 +85,7 @@ Commands:
--quality
Image quality (default "75")
--effort
Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-10), -1 uses the format default (default "-1")
Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-7), -1 uses the format default (default "-1")
--lossless
Lossless compression (webp, avif, jxl), ignores quality (default "false")
--combine
@@ -141,7 +141,7 @@ Commands:
--quality
Image quality (default "75")
--effort
Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-10), -1 uses the format default (default "-1")
Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-7), -1 uses the format default (default "-1")
--lossless
Lossless compression (webp, avif, jxl), ignores quality (default "false")
--filter
+12 -13
View File
@@ -14,12 +14,11 @@ import (
"strings"
"sync/atomic"
"github.com/gen2brain/avif"
"github.com/gen2brain/gav1d/avif"
"github.com/gen2brain/go-fitz"
"github.com/gen2brain/jpegli"
"github.com/gen2brain/jpegn"
"github.com/gen2brain/jpegxl"
"github.com/gen2brain/webp"
"github.com/gen2brain/jxl"
"github.com/gen2brain/vpx/webp"
"github.com/jsummers/gobmp"
"github.com/mholt/archives"
"golang.org/x/image/tiff"
@@ -422,13 +421,13 @@ func (c *Converter) imageEncode(img image.Image, w io.Writer) error {
case "tiff":
err = tiff.Encode(w, img, &tiff.Options{Compression: tiff.Uncompressed})
case "jpeg":
opts := &jpegli.EncodingOptions{}
opts := &jpegn.EncodeOptions{}
opts.Quality = c.Opts.Quality
opts.ChromaSubsampling = image.YCbCrSubsampleRatio420
opts.ProgressiveLevel = 2
opts.Subsampling = jpegn.Subsample420
opts.Progressive = true
opts.OptimizeCoding = true
opts.AdaptiveQuantization = true
opts.DCTMethod = jpegli.DefaultDCTMethod
err = jpegli.Encode(w, img, opts)
err = jpegn.Encode(w, img, opts)
case "webp":
method := webp.DefaultMethod
if c.Opts.Effort >= 0 {
@@ -440,13 +439,13 @@ func (c *Converter) imageEncode(img image.Image, w io.Writer) error {
if c.Opts.Effort >= 0 {
speed = min(max(c.Opts.Effort, 0), 10)
}
err = avif.Encode(w, img, avif.Options{Quality: c.Opts.Quality, Speed: speed, Lossless: c.Opts.Lossless})
err = avif.Encode(w, img, avif.EncodeOptions{Quality: c.Opts.Quality, Speed: speed, Lossless: c.Opts.Lossless})
case "jxl":
effort := jpegxl.DefaultEffort
effort := jxl.DefaultEffort
if c.Opts.Effort >= 0 {
effort = min(max(c.Opts.Effort, 1), 10)
effort = min(max(c.Opts.Effort, 1), jxl.MaxEffort)
}
err = jpegxl.Encode(w, img, jpegxl.Options{Quality: c.Opts.Quality, Effort: effort, Lossless: c.Opts.Lossless})
err = jxl.Encode(w, img, jxl.EncodeOptions{Quality: c.Opts.Quality, Effort: effort, Lossless: c.Opts.Lossless})
case "bmp":
opts := &gobmp.EncoderOptions{}
opts.SupportTransparency(false)
+164 -49
View File
@@ -1,11 +1,50 @@
# github.com/anthonynsimon/bild v0.14.0
## explicit; go 1.21
# github.com/STARRY-S/zip v0.2.3
## explicit; go 1.23
github.com/STARRY-S/zip
# github.com/andybalholm/brotli v1.2.1
## explicit; go 1.22
github.com/andybalholm/brotli
github.com/andybalholm/brotli/flate
github.com/andybalholm/brotli/matchfinder
# github.com/anthonynsimon/bild v0.15.0
## explicit; go 1.26
github.com/anthonynsimon/bild/adjust
github.com/anthonynsimon/bild/clone
github.com/anthonynsimon/bild/math/f64
github.com/anthonynsimon/bild/parallel
github.com/anthonynsimon/bild/transform
github.com/anthonynsimon/bild/util
# github.com/bodgit/plumbing v1.3.0
## explicit; go 1.13
github.com/bodgit/plumbing
# github.com/bodgit/sevenzip v1.6.4
## explicit; go 1.25.0
github.com/bodgit/sevenzip
github.com/bodgit/sevenzip/internal/aes7z
github.com/bodgit/sevenzip/internal/bcj2
github.com/bodgit/sevenzip/internal/bra
github.com/bodgit/sevenzip/internal/brotli
github.com/bodgit/sevenzip/internal/bzip2
github.com/bodgit/sevenzip/internal/deflate
github.com/bodgit/sevenzip/internal/delta
github.com/bodgit/sevenzip/internal/lz4
github.com/bodgit/sevenzip/internal/lzma
github.com/bodgit/sevenzip/internal/lzma2
github.com/bodgit/sevenzip/internal/pool
github.com/bodgit/sevenzip/internal/ppmd
github.com/bodgit/sevenzip/internal/util
github.com/bodgit/sevenzip/internal/zstd
# github.com/bodgit/windows v1.0.1
## explicit; go 1.13
github.com/bodgit/windows
# github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
## explicit; go 1.9
github.com/dsnet/compress
github.com/dsnet/compress/bzip2
github.com/dsnet/compress/bzip2/internal/sais
github.com/dsnet/compress/internal
github.com/dsnet/compress/internal/errors
github.com/dsnet/compress/internal/prefix
# github.com/dsoprea/go-exif/v2 v2.0.0-20230826092837-6579e82b732d
## explicit; go 1.13
github.com/dsoprea/go-exif/v2
@@ -23,88 +62,140 @@ github.com/dsoprea/go-utility/image
# github.com/dustin/go-humanize v1.0.1
## explicit; go 1.16
github.com/dustin/go-humanize
# github.com/ebitengine/purego v0.8.1
# github.com/ebitengine/purego v0.10.1
## explicit; go 1.18
github.com/ebitengine/purego
github.com/ebitengine/purego/internal/cgo
github.com/ebitengine/purego/internal/fakecgo
github.com/ebitengine/purego/internal/strings
github.com/ebitengine/purego/internal/xreflect
# github.com/fvbommel/sortorder v1.1.0
## explicit; go 1.13
github.com/fvbommel/sortorder
# github.com/gen2brain/avif v0.4.1
## explicit; go 1.21
# github.com/gen2brain/avif v0.5.1
## explicit; go 1.25.0
github.com/gen2brain/avif
# github.com/gen2brain/cbconvert v1.0.5-0.20241106181414-0dee611bf1de
## explicit; go 1.23
# github.com/gen2brain/cbconvert v1.2.0
## explicit; go 1.26
github.com/gen2brain/cbconvert
# github.com/gen2brain/go-fitz v1.24.14
## explicit; go 1.22
# github.com/gen2brain/go-fitz v1.28.1
## explicit; go 1.24.0
github.com/gen2brain/go-fitz
github.com/gen2brain/go-fitz/include/mupdf
github.com/gen2brain/go-fitz/include/mupdf/fitz
github.com/gen2brain/go-fitz/libs
# github.com/gen2brain/go-unarr v0.2.4
# github.com/gen2brain/iup-go/iup v0.32.1-0.20260627135200-7df674d35173
## explicit; go 1.21
github.com/gen2brain/go-unarr
github.com/gen2brain/go-unarr/unarrc
github.com/gen2brain/go-unarr/unarrc/external
github.com/gen2brain/go-unarr/unarrc/external/bzip2
github.com/gen2brain/go-unarr/unarrc/external/unarr
github.com/gen2brain/go-unarr/unarrc/external/unarr/_7z
github.com/gen2brain/go-unarr/unarrc/external/unarr/common
github.com/gen2brain/go-unarr/unarrc/external/unarr/lzmasdk
github.com/gen2brain/go-unarr/unarrc/external/unarr/rar
github.com/gen2brain/go-unarr/unarrc/external/unarr/tar
github.com/gen2brain/go-unarr/unarrc/external/unarr/zip
github.com/gen2brain/go-unarr/unarrc/external/zlib
# github.com/gen2brain/iup-go/iup v0.0.0-20241106050025-0f971ac33ed4
## explicit; go 1.22
github.com/gen2brain/iup-go/iup
github.com/gen2brain/iup-go/iup/external
github.com/gen2brain/iup-go/iup/external/include
github.com/gen2brain/iup-go/iup/external/src
github.com/gen2brain/iup-go/iup/external/src/android
github.com/gen2brain/iup-go/iup/external/src/cocoa
github.com/gen2brain/iup-go/iup/external/src/cocoatouch
github.com/gen2brain/iup-go/iup/external/src/efl
github.com/gen2brain/iup-go/iup/external/src/gtk
github.com/gen2brain/iup-go/iup/external/src/gtk4
github.com/gen2brain/iup-go/iup/external/src/haiku
github.com/gen2brain/iup-go/iup/external/src/mot
github.com/gen2brain/iup-go/iup/external/src/qt
github.com/gen2brain/iup-go/iup/external/src/win
github.com/gen2brain/iup-go/iup/external/src/win/wdl
github.com/gen2brain/iup-go/iup/external/src/win/wdl/dummy
github.com/gen2brain/iup-go/iup/external/src/winui
github.com/gen2brain/iup-go/iup/external/src/winui/winrt
github.com/gen2brain/iup-go/iup/external/src/winui/winrt/impl
github.com/gen2brain/iup-go/iup/external/srcctrl
github.com/gen2brain/iup-go/iup/external/srcctrl/matrix
github.com/gen2brain/iup-go/iup/external/srcctrl/matrixex
github.com/gen2brain/iup-go/iup/external/srcgl
github.com/gen2brain/iup-go/iup/external/srcplot
github.com/gen2brain/iup-go/iup/external/srcweb
github.com/gen2brain/iup-go/iup/manifest
# github.com/gen2brain/jpegli v0.3.3
## explicit; go 1.22
# github.com/gen2brain/jpegli v0.4.1
## explicit; go 1.25.0
github.com/gen2brain/jpegli
# github.com/gen2brain/jpegxl v0.4.2
## explicit; go 1.22
# github.com/gen2brain/jpegn v0.4.2
## explicit; go 1.23.0
github.com/gen2brain/jpegn
# github.com/gen2brain/jpegxl v0.5.2
## explicit; go 1.25.0
github.com/gen2brain/jpegxl
# github.com/gen2brain/webp v0.5.1
## explicit; go 1.22
# github.com/gen2brain/webp v0.6.1
## explicit; go 1.23
github.com/gen2brain/webp
# github.com/go-errors/errors v1.5.1
## explicit; go 1.14
github.com/go-errors/errors
# github.com/godbus/dbus/v5 v5.1.0
## explicit; go 1.12
github.com/godbus/dbus/v5
# github.com/golang/geo v0.0.0-20230421003525-6adc56603217
## explicit; go 1.18
# github.com/golang/geo v0.0.0-20260625163123-7c0e84413537
## explicit; go 1.23.0
github.com/golang/geo/r1
github.com/golang/geo/r2
github.com/golang/geo/r3
github.com/golang/geo/s1
github.com/golang/geo/s2
# github.com/google/uuid v1.6.0
## explicit
github.com/google/uuid
# github.com/hashicorp/golang-lru/v2 v2.0.7
## explicit; go 1.18
github.com/hashicorp/golang-lru/v2
github.com/hashicorp/golang-lru/v2/internal
github.com/hashicorp/golang-lru/v2/simplelru
# github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25
## explicit
github.com/jsummers/gobmp
# github.com/jupiterrider/ffi v0.2.1
## explicit; go 1.18
github.com/jupiterrider/ffi
# github.com/tetratelabs/wazero v1.8.1
# github.com/klauspost/compress v1.18.6
## explicit; go 1.24
github.com/klauspost/compress
github.com/klauspost/compress/flate
github.com/klauspost/compress/fse
github.com/klauspost/compress/gzip
github.com/klauspost/compress/huff0
github.com/klauspost/compress/internal/cpuinfo
github.com/klauspost/compress/internal/godebug
github.com/klauspost/compress/internal/le
github.com/klauspost/compress/internal/race
github.com/klauspost/compress/internal/snapref
github.com/klauspost/compress/s2
github.com/klauspost/compress/zip
github.com/klauspost/compress/zlib
github.com/klauspost/compress/zstd
github.com/klauspost/compress/zstd/internal/xxhash
# github.com/klauspost/pgzip v1.2.6
## explicit
github.com/klauspost/pgzip
# github.com/mholt/archives v0.1.5
## explicit; go 1.24.0
github.com/mholt/archives
# github.com/mikelolasagasti/xz v1.0.1
## explicit; go 1.15
github.com/mikelolasagasti/xz
# github.com/minio/minlz v1.1.1
## explicit; go 1.21
github.com/minio/minlz
github.com/minio/minlz/internal/race
# github.com/nwaples/rardecode/v2 v2.2.5
## explicit; go 1.21
github.com/nwaples/rardecode/v2
# github.com/pierrec/lz4/v4 v4.1.27
## explicit; go 1.17
github.com/pierrec/lz4/v4
github.com/pierrec/lz4/v4/internal/lz4block
github.com/pierrec/lz4/v4/internal/lz4errors
github.com/pierrec/lz4/v4/internal/lz4stream
github.com/pierrec/lz4/v4/internal/xxh32
# github.com/sorairolake/lzip-go v0.3.8
## explicit; go 1.22
github.com/sorairolake/lzip-go
# github.com/spf13/afero v1.15.0
## explicit; go 1.23.0
github.com/spf13/afero
github.com/spf13/afero/internal/common
github.com/spf13/afero/mem
# github.com/stangelandcl/ppmd v0.1.1
## explicit; go 1.17
github.com/stangelandcl/ppmd
github.com/stangelandcl/ppmd/internal/h7z
# github.com/tetratelabs/wazero v1.12.0
## explicit; go 1.25.0
github.com/tetratelabs/wazero
github.com/tetratelabs/wazero/api
github.com/tetratelabs/wazero/experimental
@@ -122,7 +213,6 @@ github.com/tetratelabs/wazero/internal/engine/wazevo/ssa
github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi
github.com/tetratelabs/wazero/internal/expctxkeys
github.com/tetratelabs/wazero/internal/filecache
github.com/tetratelabs/wazero/internal/fsapi
github.com/tetratelabs/wazero/internal/ieee754
github.com/tetratelabs/wazero/internal/internalapi
github.com/tetratelabs/wazero/internal/leb128
@@ -140,17 +230,42 @@ github.com/tetratelabs/wazero/internal/wasm/binary
github.com/tetratelabs/wazero/internal/wasmdebug
github.com/tetratelabs/wazero/internal/wasmruntime
github.com/tetratelabs/wazero/sys
# golang.org/x/image v0.21.0
## explicit; go 1.18
# github.com/ulikunitz/xz v0.5.15
## explicit; go 1.12
github.com/ulikunitz/xz
github.com/ulikunitz/xz/internal/hash
github.com/ulikunitz/xz/internal/xlog
github.com/ulikunitz/xz/lzma
# go4.org v0.0.0-20260112195520-a5071408f32f
## explicit; go 1.24.0
go4.org/readerutil
# golang.org/x/image v0.43.0
## explicit; go 1.25.0
golang.org/x/image/ccitt
golang.org/x/image/internal/safemath
golang.org/x/image/tiff
golang.org/x/image/tiff/lzw
# golang.org/x/net v0.30.0
## explicit; go 1.18
# golang.org/x/net v0.56.0
## explicit; go 1.25.0
golang.org/x/net/context
# golang.org/x/sync v0.8.0
## explicit; go 1.18
# golang.org/x/sync v0.21.0
## explicit; go 1.25.0
golang.org/x/sync/errgroup
# golang.org/x/sys v0.46.0
## explicit; go 1.25.0
golang.org/x/sys/cpu
golang.org/x/sys/unix
golang.org/x/sys/windows
# golang.org/x/text v0.38.0
## explicit; go 1.25.0
golang.org/x/text/encoding
golang.org/x/text/encoding/internal
golang.org/x/text/encoding/internal/identifier
golang.org/x/text/encoding/unicode
golang.org/x/text/internal/utf8internal
golang.org/x/text/runes
golang.org/x/text/transform
golang.org/x/text/unicode/norm
# gopkg.in/yaml.v2 v2.4.0
## explicit; go 1.15
gopkg.in/yaml.v2
+2 -2
View File
@@ -4,7 +4,7 @@ go 1.26
require (
github.com/fvbommel/sortorder v1.1.0
github.com/gen2brain/cbconvert v1.0.5-0.20260627172825-0f6e32c177ee
github.com/gen2brain/cbconvert v1.2.0
github.com/gen2brain/iup-go/iup v0.32.1-0.20260627135200-7df674d35173
)
@@ -23,7 +23,7 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.10.1 // indirect
github.com/gen2brain/avif v0.5.1 // indirect
github.com/gen2brain/go-fitz v1.28.0 // indirect
github.com/gen2brain/go-fitz v1.28.2 // indirect
github.com/gen2brain/jpegli v0.4.1 // indirect
github.com/gen2brain/jpegn v0.4.2 // indirect
github.com/gen2brain/jpegxl v0.5.2 // indirect
+3 -4
View File
@@ -40,10 +40,9 @@ github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQ
github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
github.com/gen2brain/avif v0.5.1 h1:LQzLsJpWyGlsa4wuZ3D57qEbCiICIK7Yidz5ZPEwzTk=
github.com/gen2brain/avif v0.5.1/go.mod h1:QgrYqdVE9y40PCfArK9VakcMIpYeDYpZmCSLkW6C1n8=
github.com/gen2brain/cbconvert v1.0.5-0.20260627172825-0f6e32c177ee h1:9ggHORYXL+0zSdfC0bJA049amaH5wW6jZgO5dGisKm4=
github.com/gen2brain/cbconvert v1.0.5-0.20260627172825-0f6e32c177ee/go.mod h1:KrAZdAzcMj1XQkfDz5bp0hotVFUB2k9hRT+9F4b5f2E=
github.com/gen2brain/go-fitz v1.28.0 h1:RovqgQPAcOuyv5HZrWsTWl8qwlwbAHSKcAZXZUw0Vlk=
github.com/gen2brain/go-fitz v1.28.0/go.mod h1:pY2hqAjp9Zy7qfPI2gwbJMHBFAdZpVXOLrRxD82l3Bs=
github.com/gen2brain/cbconvert v1.2.0 h1:eUs5MPzft+Lo9ADMYYQ5AzydO54Pv0YYUTm2lPo3XDo=
github.com/gen2brain/cbconvert v1.2.0/go.mod h1:/6QtSgf47bDBmtkidNoYwNMHaebsDhPTKnDMmyNUd9E=
github.com/gen2brain/go-fitz v1.28.2 h1:845G85N5TUgnq5oDqyYrW0JvehAkeo35UkkK2dJtW1M=
github.com/gen2brain/iup-go/iup v0.32.1-0.20260627135200-7df674d35173 h1:nBt0N1ixK8eg/7RXJIC4b0WDPxfENqyT+rH1/STZGj4=
github.com/gen2brain/iup-go/iup v0.32.1-0.20260627135200-7df674d35173/go.mod h1:V4f7tHOJAeHtjQ+ju795QKv6DGdLEb4L5cmWB1sjSzU=
github.com/gen2brain/jpegli v0.4.1 h1:qc11IQU0jTYFltroulT4MXmbu9YRftqHV0YBZ0Bqz5o=
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Rychlost",
EffortEffort: "Úsilí",
TipEffortWebp: "Metoda WEBP, vyšší je lepší/pomalejší (0-6, výchozí 4)",
TipEffortAvif: "Rychlost AVIF, vyšší je rychlejší/horší (0-10, výchozí 10)",
TipEffortJxl: "Úsilí JXL, vyšší je lepší/pomalejší (1-10, výchozí 7)",
TipEffortAvif: "Rychlost AVIF, vyšší je rychlejší/horší (0-10, výchozí 6)",
TipEffortJxl: "Úsilí JXL, vyšší je lepší/pomalejší (1-7, výchozí 7)",
BtnAddFiles: "Přidat &soubory...",
BtnAddDir: "Přidat &adresář...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Geschwindigkeit",
EffortEffort: "Aufwand",
TipEffortWebp: "WEBP-Methode, höher ist besser/langsamer (0-6, Standard 4)",
TipEffortAvif: "AVIF-Geschwindigkeit, höher ist schneller/schlechter (0-10, Standard 10)",
TipEffortJxl: "JXL-Aufwand, höher ist besser/langsamer (1-10, Standard 7)",
TipEffortAvif: "AVIF-Geschwindigkeit, höher ist schneller/schlechter (0-10, Standard 6)",
TipEffortJxl: "JXL-Aufwand, höher ist besser/langsamer (1-7, Standard 7)",
BtnAddFiles: "&Dateien hinzufügen...",
BtnAddDir: "&Verzeichnis hinzufügen...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Speed",
EffortEffort: "Effort",
TipEffortWebp: "WEBP method, higher is better/slower (0-6, default 4)",
TipEffortAvif: "AVIF speed, higher is faster/worse (0-10, default 10)",
TipEffortJxl: "JXL effort, higher is better/slower (1-10, default 7)",
TipEffortAvif: "AVIF speed, higher is faster/worse (0-10, default 6)",
TipEffortJxl: "JXL effort, higher is better/slower (1-7, default 7)",
BtnAddFiles: "Add &Files...",
BtnAddDir: "Add &Dir...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Velocidad",
EffortEffort: "Esfuerzo",
TipEffortWebp: "Método WEBP, más alto es mejor/más lento (0-6, predeterminado 4)",
TipEffortAvif: "Velocidad AVIF, más alto es más rápido/peor (0-10, predeterminado 10)",
TipEffortJxl: "Esfuerzo JXL, más alto es mejor/más lento (1-10, predeterminado 7)",
TipEffortAvif: "Velocidad AVIF, más alto es más rápido/peor (0-10, predeterminado 6)",
TipEffortJxl: "Esfuerzo JXL, más alto es mejor/más lento (1-7, predeterminado 7)",
BtnAddFiles: "Añadir &archivos...",
BtnAddDir: "Añadir &directorio...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Vitesse",
EffortEffort: "Effort",
TipEffortWebp: "Méthode WEBP, plus élevé est meilleur/plus lent (0-6, défaut 4)",
TipEffortAvif: "Vitesse AVIF, plus élevé est plus rapide/moins bon (0-10, défaut 10)",
TipEffortJxl: "Effort JXL, plus élevé est meilleur/plus lent (1-10, défaut 7)",
TipEffortAvif: "Vitesse AVIF, plus élevé est plus rapide/moins bon (0-10, défaut 6)",
TipEffortJxl: "Effort JXL, plus élevé est meilleur/plus lent (1-7, défaut 7)",
BtnAddFiles: "Ajouter des &fichiers...",
BtnAddDir: "Ajouter un &dossier...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Velocità",
EffortEffort: "Sforzo",
TipEffortWebp: "Metodo WEBP, più alto è migliore/più lento (0-6, predefinito 4)",
TipEffortAvif: "Velocità AVIF, più alto è più veloce/peggiore (0-10, predefinito 10)",
TipEffortJxl: "Sforzo JXL, più alto è migliore/più lento (1-10, predefinito 7)",
TipEffortAvif: "Velocità AVIF, più alto è più veloce/peggiore (0-10, predefinito 6)",
TipEffortJxl: "Sforzo JXL, più alto è migliore/più lento (1-7, predefinito 7)",
BtnAddFiles: "Aggiungi &file...",
BtnAddDir: "Aggiungi &cartella...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "速度",
EffortEffort: "労力",
TipEffortWebp: "WEBP 方式、高いほど高品質/低速(0-6、既定 4)",
TipEffortAvif: "AVIF 速度、高いほど高速/低品質(0-10、既定 10",
TipEffortJxl: "JXL 労力、高いほど高品質/低速(1-10、既定 7",
TipEffortAvif: "AVIF 速度、高いほど高速/低品質(0-10、既定 6",
TipEffortJxl: "JXL 労力、高いほど高品質/低速(1-7、既定 7",
BtnAddFiles: "ファイルを追加(&F)...",
BtnAddDir: "ディレクトリを追加(&D)...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Velocidade",
EffortEffort: "Esforço",
TipEffortWebp: "Método WEBP, mais alto é melhor/mais lento (0-6, padrão 4)",
TipEffortAvif: "Velocidade AVIF, mais alto é mais rápido/pior (0-10, padrão 10)",
TipEffortJxl: "Esforço JXL, mais alto é melhor/mais lento (1-10, padrão 7)",
TipEffortAvif: "Velocidade AVIF, mais alto é mais rápido/pior (0-10, padrão 6)",
TipEffortJxl: "Esforço JXL, mais alto é melhor/mais lento (1-7, padrão 7)",
BtnAddFiles: "Adicionar &arquivos...",
BtnAddDir: "Adicionar &diretório...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "Скорость",
EffortEffort: "Усилие",
TipEffortWebp: "Метод WEBP, выше — лучше/медленнее (0-6, по умолчанию 4)",
TipEffortAvif: "Скорость AVIF, выше — быстрее/хуже (0-10, по умолчанию 10)",
TipEffortJxl: "Усилие JXL, выше — лучше/медленнее (1-10, по умолчанию 7)",
TipEffortAvif: "Скорость AVIF, выше — быстрее/хуже (0-10, по умолчанию 6)",
TipEffortJxl: "Усилие JXL, выше — лучше/медленнее (1-7, по умолчанию 7)",
BtnAddFiles: "Добавить &файлы...",
BtnAddDir: "Добавить &каталог...",
+2 -2
View File
@@ -74,8 +74,8 @@ func init() {
EffortSpeed: "速度",
EffortEffort: "强度",
TipEffortWebp: "WEBP 方法,越高越好/越慢(0-6,默认 4)",
TipEffortAvif: "AVIF 速度,越高越快/越差(0-10,默认 10",
TipEffortJxl: "JXL 强度,越高越好/越慢(1-10,默认 7",
TipEffortAvif: "AVIF 速度,越高越快/越差(0-10,默认 6",
TipEffortJxl: "JXL 强度,越高越好/越慢(1-7,默认 7",
BtnAddFiles: "添加文件(&F)...",
BtnAddDir: "添加目录(&D)...",
+3
View File
@@ -8,3 +8,6 @@ Linux
macOS
<img src="macos-01.jpg" width="700" title="macOS" alt="macOS" />
Haiku
<img src="haiku-01.png" width="700" title="Haiku" alt="Haiku" />
Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

+4 -37
View File
@@ -1,38 +1,12 @@
package main
import (
"runtime/debug"
"strings"
"github.com/gen2brain/cbconvert/cmd/cbconvert-gui/i18n"
"github.com/gen2brain/iup-go/iup"
)
// jxlLosslessBuild reports whether wasm2go and nodynamic leave zune-jpegxl (lossless-only) as the only jxl encoder.
var jxlLosslessBuild = func() bool {
info, ok := debug.ReadBuildInfo()
if !ok {
return false
}
var wasm2go, nodynamic bool
for _, kv := range info.Settings {
if kv.Key != "-tags" {
continue
}
for _, t := range strings.Split(kv.Value, ",") {
switch t {
case "wasm2go":
wasm2go = true
case "nodynamic":
nodynamic = true
}
}
}
return wasm2go && nodynamic
}()
// userLossless is the user's Lossless preference, tracked separately because a jxl
// wasm2go build force-sets the widget on.
// userLossless is the user's Lossless preference, kept so switching to a format
// without lossless support and back does not clear it.
var userLossless bool
func setActive() {
@@ -98,15 +72,13 @@ func setActive() {
}
canLossless := opts.Format == "webp" || opts.Format == "avif" || opts.Format == "jxl"
jxlLossless := jxlLosslessBuild && opts.Format == "jxl"
// jxl wasm2go forces lossless on; otherwise show the user's preference so it doesn't stay stuck on.
losslessVal := "OFF"
if jxlLossless || userLossless {
if userLossless {
losslessVal = "ON"
}
iup.GetHandle("Lossless").SetAttribute("VALUE", losslessVal)
losslessOn := jxlLossless || (canLossless && userLossless)
losslessOn := canLossless && userLossless
if (opts.Format == "jpeg" || canLossless) && !opts.NoConvert && !losslessOn {
iup.GetHandle("VboxQuality").SetAttribute("ACTIVE", "YES")
@@ -122,11 +94,6 @@ func setActive() {
iup.GetHandle("Lossless").SetAttribute("ACTIVE", "NO")
}
if jxlLossless {
iup.GetHandle("Lossless").SetAttribute("ACTIVE", "NO")
iup.GetHandle("VboxEffort").SetAttribute("ACTIVE", "NO")
}
if opts.Width != 0 && opts.Height != 0 && !opts.NoConvert {
iup.GetHandle("Fit").SetAttribute("ACTIVE", "YES")
} else {
+2 -2
View File
@@ -25,11 +25,11 @@ func setEffort(format string) {
val.SetAttribute("TIP", i18n.Lng(i18n.TipEffortWebp))
name = i18n.Str(i18n.EffortMethod)
case "avif":
val.SetAttributes("MIN=0, MAX=10, SHOWTICKS=11, VALUE=10")
val.SetAttributes("MIN=0, MAX=10, SHOWTICKS=11, VALUE=6")
val.SetAttribute("TIP", i18n.Lng(i18n.TipEffortAvif))
name = i18n.Str(i18n.EffortSpeed)
case "jxl":
val.SetAttributes("MIN=1, MAX=10, SHOWTICKS=10, VALUE=7")
val.SetAttributes("MIN=1, MAX=7, SHOWTICKS=7, VALUE=7")
val.SetAttribute("TIP", i18n.Lng(i18n.TipEffortJxl))
name = i18n.Str(i18n.EffortEffort)
default:
+2 -2
View File
@@ -3,7 +3,7 @@ module github.com/gen2brain/cbconvert/cmd/cbconvert
go 1.26
require (
github.com/gen2brain/cbconvert v1.0.5-0.20260627172825-0f6e32c177ee
github.com/gen2brain/cbconvert v1.2.0
github.com/schollz/progressbar/v3 v3.19.0
golang.org/x/term v0.44.0
)
@@ -24,7 +24,7 @@ require (
github.com/ebitengine/purego v0.10.1 // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/gen2brain/avif v0.5.1 // indirect
github.com/gen2brain/go-fitz v1.28.0 // indirect
github.com/gen2brain/go-fitz v1.28.2 // indirect
github.com/gen2brain/jpegli v0.4.1 // indirect
github.com/gen2brain/jpegn v0.4.2 // indirect
github.com/gen2brain/jpegxl v0.5.2 // indirect
+3 -4
View File
@@ -44,10 +44,9 @@ github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQ
github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
github.com/gen2brain/avif v0.5.1 h1:LQzLsJpWyGlsa4wuZ3D57qEbCiICIK7Yidz5ZPEwzTk=
github.com/gen2brain/avif v0.5.1/go.mod h1:QgrYqdVE9y40PCfArK9VakcMIpYeDYpZmCSLkW6C1n8=
github.com/gen2brain/cbconvert v1.0.5-0.20260627172825-0f6e32c177ee h1:9ggHORYXL+0zSdfC0bJA049amaH5wW6jZgO5dGisKm4=
github.com/gen2brain/cbconvert v1.0.5-0.20260627172825-0f6e32c177ee/go.mod h1:KrAZdAzcMj1XQkfDz5bp0hotVFUB2k9hRT+9F4b5f2E=
github.com/gen2brain/go-fitz v1.28.0 h1:RovqgQPAcOuyv5HZrWsTWl8qwlwbAHSKcAZXZUw0Vlk=
github.com/gen2brain/go-fitz v1.28.0/go.mod h1:pY2hqAjp9Zy7qfPI2gwbJMHBFAdZpVXOLrRxD82l3Bs=
github.com/gen2brain/cbconvert v1.2.0 h1:eUs5MPzft+Lo9ADMYYQ5AzydO54Pv0YYUTm2lPo3XDo=
github.com/gen2brain/cbconvert v1.2.0/go.mod h1:/6QtSgf47bDBmtkidNoYwNMHaebsDhPTKnDMmyNUd9E=
github.com/gen2brain/go-fitz v1.28.2 h1:845G85N5TUgnq5oDqyYrW0JvehAkeo35UkkK2dJtW1M=
github.com/gen2brain/jpegli v0.4.1 h1:qc11IQU0jTYFltroulT4MXmbu9YRftqHV0YBZ0Bqz5o=
github.com/gen2brain/jpegli v0.4.1/go.mod h1:zJ++s4symmKCN1CLkrY0dGXTY3s0NWbd94Rz9KLdCzk=
github.com/gen2brain/jpegn v0.4.2 h1:sxy2yolV1eNA02uYtnqBFm4EIC3ETnars98aG7Dc4LM=
+2 -2
View File
@@ -221,7 +221,7 @@ func parseFlags() (cbconvert.Options, []string) {
convert.StringVar(&opts.Archive, "archive", base.Archive, "Archive format, valid values are zip, tar")
convert.IntVar(&opts.ZipLevel, "zip-level", base.ZipLevel, "ZIP compression level, 0 disables compression, 1-9 sets deflate level (1 fastest, 9 smallest), -1 uses the default")
convert.IntVar(&opts.Quality, "quality", base.Quality, "Image quality")
convert.IntVar(&opts.Effort, "effort", base.Effort, "Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-10), -1 uses the format default")
convert.IntVar(&opts.Effort, "effort", base.Effort, "Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-7), -1 uses the format default")
convert.BoolVar(&opts.Lossless, "lossless", base.Lossless, "Lossless compression (webp, avif, jxl), ignores quality")
convert.BoolVar(&opts.Combine, "combine", base.Combine, "Combine all inputs into a single archive")
convert.StringVar(&opts.OutFile, "outfile", base.OutFile, "Output file name for --combine (default: first input + -combined)")
@@ -249,7 +249,7 @@ func parseFlags() (cbconvert.Options, []string) {
cover.IntVar(&opts.DPI, "dpi", base.DPI, "Document rendering resolution in DPI (PDF, EPUB, etc.), 0 uses the original resolution")
cover.StringVar(&opts.Format, "format", base.Format, "Image format, valid values are jpeg, png, tiff, bmp, webp, avif")
cover.IntVar(&opts.Quality, "quality", base.Quality, "Image quality")
cover.IntVar(&opts.Effort, "effort", base.Effort, "Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-10), -1 uses the format default")
cover.IntVar(&opts.Effort, "effort", base.Effort, "Encoder speed/effort, format-specific (webp method 0-6, avif speed 0-10, jxl effort 1-7), -1 uses the format default")
cover.BoolVar(&opts.Lossless, "lossless", base.Lossless, "Lossless compression (webp, avif, jxl), ignores quality")
cover.IntVar(&opts.Filter, "filter", base.Filter, "0=NearestNeighbor, 1=Box, 2=Linear, 3=MitchellNetravali, 4=CatmullRom, 5=Gaussian, 6=Lanczos")
cover.StringVar(&opts.OutDir, "outdir", base.OutDir, "Output directory")
+6 -8
View File
@@ -1,17 +1,16 @@
module github.com/gen2brain/cbconvert
go 1.26
go 1.26.4
require (
github.com/anthonynsimon/bild v0.15.0
github.com/dsoprea/go-png-image-structure v0.0.0-20210512210324-29b889a6093d
github.com/dustin/go-humanize v1.0.1
github.com/fvbommel/sortorder v1.1.0
github.com/gen2brain/avif v0.5.1
github.com/gen2brain/go-fitz v1.28.1
github.com/gen2brain/jpegli v0.4.1
github.com/gen2brain/jpegxl v0.5.2
github.com/gen2brain/webp v0.6.1
github.com/gen2brain/gav1d v0.2.4
github.com/gen2brain/go-fitz v1.28.2
github.com/gen2brain/jxl v0.2.0
github.com/gen2brain/vpx v0.1.0
github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25
github.com/mholt/archives v0.1.5
golang.org/x/image v0.43.0
@@ -29,7 +28,7 @@ require (
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/dsoprea/go-utility v0.0.0-20221003172846-a3e1774ef349 // indirect
github.com/ebitengine/purego v0.10.1 // indirect
github.com/gen2brain/jpegn v0.4.2
github.com/gen2brain/jpegn v0.6.0
github.com/go-errors/errors v1.5.1 // indirect
github.com/golang/geo v0.0.0-20260625163123-7c0e84413537 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
@@ -42,7 +41,6 @@ require (
github.com/sorairolake/lzip-go v0.3.8 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/stangelandcl/ppmd v0.1.1 // indirect
github.com/tetratelabs/wazero v1.12.0 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
go4.org v0.0.0-20260112195520-a5071408f32f // indirect
golang.org/x/net v0.56.0 // indirect
+10 -14
View File
@@ -38,18 +38,16 @@ github.com/ebitengine/purego v0.10.1 h1:dewVBCBT2GaMu1SrNTYxQhgQBethzfhiwvZiLGP/
github.com/ebitengine/purego v0.10.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw=
github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
github.com/gen2brain/avif v0.5.1 h1:LQzLsJpWyGlsa4wuZ3D57qEbCiICIK7Yidz5ZPEwzTk=
github.com/gen2brain/avif v0.5.1/go.mod h1:QgrYqdVE9y40PCfArK9VakcMIpYeDYpZmCSLkW6C1n8=
github.com/gen2brain/go-fitz v1.28.1 h1:ToEYb2vN4ByaL2VmRNGk92Sa1UAkCn8bsObpA3WkQ48=
github.com/gen2brain/go-fitz v1.28.1/go.mod h1:pY2hqAjp9Zy7qfPI2gwbJMHBFAdZpVXOLrRxD82l3Bs=
github.com/gen2brain/jpegli v0.4.1 h1:qc11IQU0jTYFltroulT4MXmbu9YRftqHV0YBZ0Bqz5o=
github.com/gen2brain/jpegli v0.4.1/go.mod h1:zJ++s4symmKCN1CLkrY0dGXTY3s0NWbd94Rz9KLdCzk=
github.com/gen2brain/jpegn v0.4.2 h1:sxy2yolV1eNA02uYtnqBFm4EIC3ETnars98aG7Dc4LM=
github.com/gen2brain/jpegn v0.4.2/go.mod h1:YvcVOmVPSAsefH6yn9HBW3uY0EHlZwCMoiJXoAWfgL0=
github.com/gen2brain/jpegxl v0.5.2 h1:1ou9YRziU8PbpkfFJIyxrNjYM+WaMl2n9LloABxkKsU=
github.com/gen2brain/jpegxl v0.5.2/go.mod h1:Wlc6lqx03RJfhiQRyHa2e+8VQwT4/qv7zSRsNv9T+yE=
github.com/gen2brain/webp v0.6.1 h1:ei7Y1SWpQcdqz3YNDNyn4y2nQanxs9WLzwW5/2DKS64=
github.com/gen2brain/webp v0.6.1/go.mod h1:iGWMaCSw7t3I/Cv9llzEKmpnR36S8lS8VL/ZVjxU0JE=
github.com/gen2brain/gav1d v0.2.4 h1:Fe+Hpvul5I+svHQ1FqWmvgTeNPWYNCulox7pSoY4M+8=
github.com/gen2brain/gav1d v0.2.4/go.mod h1:ReFKjHq7pvRhEk+pgRPAo9gOlcrf51sdzVcAbbX7e0E=
github.com/gen2brain/go-fitz v1.28.2 h1:845G85N5TUgnq5oDqyYrW0JvehAkeo35UkkK2dJtW1M=
github.com/gen2brain/go-fitz v1.28.2/go.mod h1:pY2hqAjp9Zy7qfPI2gwbJMHBFAdZpVXOLrRxD82l3Bs=
github.com/gen2brain/jpegn v0.6.0 h1:MYVzF8A4Y5GoDNUotAq4uT4dUDQ0yEVYbcw9xFZgKk8=
github.com/gen2brain/jpegn v0.6.0/go.mod h1:43hks+w5VNTUDU34uk0tsXYJ97nbYL2idAlZF0D66+A=
github.com/gen2brain/jxl v0.2.0 h1:cXSQnfbcC0JGFzaI344VzPMbe7mh6rYc0tjPcBUsE4U=
github.com/gen2brain/jxl v0.2.0/go.mod h1:VjJHRai/8I8Es01mULqyiOihRBOjJr1Zo+NoN/MyIwo=
github.com/gen2brain/vpx v0.1.0 h1:2w4ftgpSid7/20nP3zc2UvOmW30QqVlo0jOtIahIhdg=
github.com/gen2brain/vpx v0.1.0/go.mod h1:EVIdqguMSiapbtjDm4AWgFgYYJ4d+k8trXqjxYZ/4XE=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
github.com/go-errors/errors v1.1.1/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
@@ -101,8 +99,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/tetratelabs/wazero v1.12.0 h1:DuWcpNu/FzgEXgGBDp8J1Spc+CWOvvtvVyjKlaZopYU=
github.com/tetratelabs/wazero v1.12.0/go.mod h1:LvKtzl2RqO4gyF27BiXU+nKAjcV8f38U+kP/q2vgxh0=
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY=
github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
+1 -1
View File
@@ -1,4 +1,4 @@
go 1.26
go 1.26.4
use (
.
+1
View File
@@ -95,6 +95,7 @@ golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4=
golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ=
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8=