A high-performance JPG image converter that uses Alpine Linux native libraries to convert JPG images to modern next-generation formats.
libjxl, libwebp, and libavif packagescjxl, cwebp, avifenc) for conversioncwebp)cjxl)avifenc)./build_docker.sh
Or manually:
docker build -t go-jpg-to-nextgen:alpine .
docker run -v $(pwd)/0_input:/app/0_input \
-v $(pwd)/1_jpg_zu_next_gen:/app/1_jpg_zu_next_gen \
go-jpg-to-nextgen:alpine
.
├── 0_input/ # Place your JPG files here
├── 1_jpg_zu_next_gen/ # Converted files will appear here
├── config.cfg # Configuration file
└── processing.log # Processing log
QUALITY=90 # Quality for all formats (0-100)
WORKERS=0 # Number of workers (0 = auto based on CPU)
BITDEPTH=8 # Bit depth for JPG conversion (8 or 16)
JXL_EFFORT=7 # JXL encoding effort (1-9, higher=slower+better)
AVIF_SPEED=6 # AVIF encoding speed (0-10, higher=faster+lower quality)
FORMATS=webp,jpg,jxl # Comma-separated list: jpg,webp,jxl,avif
This implementation does not use pure Go image encoding libraries:
chai2010/webpgen2brain/avifgen2brain/jpegxlInstead, it uses Alpine's native packages:
libjxl + libjxl-tools (provides cjxl command)libwebp + libwebp-tools (provides cwebp command)libavif + libavif-apps (provides avifenc command)cwebp input.jpg -q 90 -o output.webpcjxl input.jpg output.jxl -q 90 -e 7avifenc -q 10 -s 6 input.jpg output.avifimage/jpegRequires Alpine Linux or Alpine-compatible environment:
# Install dependencies
apk add go libjxl-tools libwebp-tools libavif-apps
# Build
go build -o go_jpg_to_nextgen main.go
# Run
./go_jpg_to_nextgen
CGO_ENABLED=0)See project license file.
Content type
Image
Digest
sha256:a8bd80a13…
Size
15.3 MB
Last updated
8 months ago
docker pull h0tmann/alpine_jpg_to_nextgen