• Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created about 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CBconvert is a Comic Book converter

CBconvert

Introduction

CBconvert is a Comic Book converter.

It can convert comics to different formats to fit your various devices.

screenshot

See more screenshots.

Features

  • reads CBR (RAR), CBZ (ZIP), CB7 (7Z), CBT (TAR), PDF, XPS, EPUB, MOBI and plain directory
  • saves processed files in ZIP archive format or TAR
  • images can be converted to JPEG, PNG, TIFF, WEBP, AVIF, JXL, or 4-Bit BMP (16 colors) image format
  • rotate, adjust brightness/contrast, adjust levels (Photoshop-like) or grayscale images
  • resize filters (NearestNeighbor, Box, Linear, MitchellNetravali, CatmullRom, Gaussian, Lanczos)
  • export covers from comics
  • create thumbnails from covers by FreeDesktop specification

Download

flathub

Using cbconvert in file managers to generate FreeDesktop thumbnails

Copy cbconvert cli binary to your PATH and create file ~/.local/share/thumbnailers/cbconvert.thumbnailer:

[Thumbnailer Entry]
TryExec=cbconvert
Exec=cbconvert thumbnail --quiet --width %s --outfile %o %i
MimeType=application/pdf;application/x-cb7;application/x-cbt;application/epub+zip;application/vnd.comicbook-rar;application/vnd.comicbook+zip;application/x-mobipocket-ebook;application/vnd.ms-xpsdocument;

This is what it looks like in the PCManFM file manager:

thumbnails

Using command line app

    Usage: cbconvert <command> [<flags>] [file1 dir1 ... fileOrDirN]


    Commands:

      convert
            Convert archive or document

        --width
            Image width (default "0")
        --height
            Image height (default "0")
        --fit
            Best fit for required width and height (default "false")
        --format
            Image format, valid values are jpeg, png, tiff, bmp, webp, avif, jxl (default "jpeg")
        --archive
    	    Archive format, valid values are zip, tar (default "zip")
        --quality
            Image quality (default "75")
        --filter
            0=NearestNeighbor, 1=Box, 2=Linear, 3=MitchellNetravali, 4=CatmullRom, 6=Gaussian, 7=Lanczos (default "2")
        --no-cover
            Do not convert the cover image (default "false")
        --no-rgb
            Do not convert images that have RGB colorspace (default "false")
        --no-nonimage
            Remove non-image files from the archive (default "false")
        --no-convert
    	    Do not transform or convert images (default "false")
        --grayscale
            Convert images to grayscale (monochromatic) (default "false")
        --rotate
            Rotate images, valid values are 0, 90, 180, 270 (default "0")
        --brightness
            Adjust the brightness of the images, must be in the range (-100, 100) (default "0")
        --contrast
            Adjust the contrast of the images, must be in the range (-100, 100) (default "0")
        --suffix
            Add suffix to file basename (default "")
        --levels-inmin
            Shadow input value (default "0")
        --levels-gamma
            Midpoint/Gamma (default "1")
        --levels-inmax
            Highlight input value (default "255")
        --levels-outmin
            Shadow output value (default "0")
        --levels-outmax
            Highlight output value (default "255")
        --outdir
            Output directory (default ".")
        --size
            Process only files larger than size (in MB) (default "0")
        --recursive
            Process subdirectories recursively (default "false")
        --quiet
            Hide console output (default "false")

      cover
            Extract cover

        --width
            Image width (default "0")
        --height
            Image height (default "0")
        --fit
            Best fit for required width and height (default "false")
        --format
            Image format, valid values are jpeg, png, tiff, bmp, webp, avif, jxl (default "jpeg")
        --quality
            Image quality (default "75")
        --filter
            0=NearestNeighbor, 1=Box, 2=Linear, 3=MitchellNetravali, 4=CatmullRom, 6=Gaussian, 7=Lanczos (default "2")
        --outdir
            Output directory (default ".")
        --size
            Process only files larger than size (in MB) (default "0")
        --recursive
            Process subdirectories recursively (default "false")
        --quiet
            Hide console output (default "false")

      thumbnail
            Extract cover thumbnail (freedesktop spec.)

        --width
            Image width (default "0")
        --height
            Image height (default "0")
        --fit
            Best fit for required width and height (default "false")
        --filter
            0=NearestNeighbor, 1=Box, 2=Linear, 3=MitchellNetravali, 4=CatmullRom, 6=Gaussian, 7=Lanczos (default "2")
        --outdir
            Output directory (default ".")
        --outfile
            Output file (default "")
        --size
            Process only files larger than size (in MB) (default "0")
        --recursive
            Process subdirectories recursively (default "false")
        --quiet
            Hide console output (default "false")

      meta
            CBZ metadata

        --cover
            Print cover name (default "false")
        --comment
            Print zip comment (default "false")
        --comment-body
            Set zip comment (default "")
        --file-add
            Add file to archive (default "")
        --file-remove
            Remove file(s) from archive (glob pattern, i.e. *.xml) (default "")

Examples

  • Rescale images to 1200px for all supported files found in a directory with a size larger than 60MB:

cbconvert --recursive --width 1200 --size 60 /media/comics/Thorgal/

  • Convert all images in pdf to 4bit BMP images and save the result in ~/comics directory:

cbconvert --format bmp --outdir ~/comics /media/comics/Garfield/Garfield_01.pdf

BMP format is a very good choice for black&white pages. Archive size can be smaller 2-3x and the file will be readable by comic readers.

  • Extract covers to ~/covers dir for all supported files found in the directory, Lanczos algorithm is used for resizing:

cbconvert cover --outdir ~/covers --filter=7 /media/comics/GrooTheWanderer/

  • Convert all images to AVIF format:

cbconvert --format avif --quality 50 --width 1280 --outdir ~/comics /media/comics/Misc/

Quality settings

This table maps quality settings for JPEG to the respective AVIF and WEBP quality settings:

JPEG quality 50 60 70 80
AVIF quality 48 51 56 64
WEBP quality 55 64 72 82

Compile

Install ImageMagick7 (with libheif/libjxl support) and MuPDF libraries and headers and then install to GOBIN:

go install -tags extlib github.com/gen2brain/cbconvert/cmd/cbconvert@latest

For GUI app, check IUP requirements, and then install:

go install -tags extlib github.com/gen2brain/cbconvert/cmd/cbconvert-gui@latest

More Repositories

1

raylib-go

Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.
C
1,528
star
2

beeep

Go cross-platform library for sending desktop notifications, alerts and beeps
Go
1,428
star
3

cam2ip

Turn any webcam into an IP camera
Go
868
star
4

url2img

HTTP server with API for capturing screenshots of websites
Go
534
star
5

go-fitz

Golang wrapper for the MuPDF Fitz library
C
396
star
6

dlgs

Go cross-platform library for displaying dialogs and input boxes
Go
383
star
7

malgo

Mini audio library
C
285
star
8

go-unarr

Go bindings for unarr (decompression library for RAR, TAR, ZIP and 7z archives)
Go
280
star
9

iup-go

Cross-platform UI library with native controls
Go
273
star
10

x264-go

Go bindings for x264
Go
211
star
11

goiv

Small and simple image viewer written in pure Go.
Go
201
star
12

shm

System V shared memory functions in pure Go.
Go
126
star
13

mpeg

MPEG-1 Video decoder, MP2 Audio decoder and MPEG-PS Demuxer in pure Go
Go
124
star
14

bukanir

Bukanir streams movies and TV shows from bittorrent magnet links
Java
84
star
15

aac-go

Go bindings for vo-aacenc
Go
58
star
16

gsmgo

GSMGo is SMS HTTP server with REST API
Go
50
star
17

keepalived_exporter

Keepalived Prometheus Exporter
Go
44
star
18

go-sdl2-android-example

Go-SDL2 example running on Android
Java
32
star
19

vov

VoV is a high score game for Android
Go
30
star
20

jpegli

Go encoder/decoder for JPEG based on jpegli
Go
29
star
21

volti

Volti is GTK+ application for controlling audio volume from system tray/notification area
Python
28
star
22

pyhtmleditor

PyQt WYSIWYG HTML Editor
Python
26
star
23

go-mpv

Go bindings for libmpv
Go
26
star
24

acra-go

Backend for Application Crash Reports for Android (ACRA)
Go
24
star
25

avif

AVIF image encoder/decoder
Go
24
star
26

jpegxl

JPEG XL image encoder/decoder
Go
16
star
27

flite-go

Go bindings for Flite (festival-lite)
Go
14
star
28

webp

WebP image encoder/decoder
Go
11
star
29

crtaci

"Crtaći" searches YouTube, DailyMotion and Vimeo for good old cartoons
Go
10
star
30

vidextr

Simple video extractor for YouTube, DailyMotion and Vimeo in Go.
Go
10
star
31

heic

HEIC image decoder
Go
9
star
32

comic-utils

Comic book archive utils
Python
6
star
33

oss

oss provides access to OSS (Open Sound System) audio interface
Go
6
star
34

svg

SVG icon decoder
Go
6
star
35

jxl

Go decoder for JPEG XL image format
C
4
star
36

mpeg-examples

Examples for mpeg library
Go
4
star
37

framebuffer

Fork of removed repo github.com/jteeuwen/framebuffer
Go
4
star
38

go-smpeg2

Golang bindings for the smpeg2 - SDL2 MPEG Player Library
Go
4
star
39

prang

A violent point-and-shoot game for android
C
2
star
40

bgradio

Qt/libVLC online radio streaming player that runs in system tray
Python
2
star
41

vim

My Vim config
Vim Script
1
star
42

base64

Fork of goost.org/encoding/base64
Go
1
star
43

umtsmon

Qt4 port of umtsmon
C++
1
star
44

libtorrent-go

SWIG Go bindings for libtorrent-rasterbar
C++
1
star