mangaconv

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 15 Imported by: 0

README

CI

mangaconv

mangaconv is a portable cli tool to convert comic and manga files/folders for reading on e-ink devices.

Currently supported input formats are zip/cbz or a folder of images. Output is a cbz archive.

This project is heavily inspired by KCC. Unlike KCC, it does not require any runtime dependencies and does not attempt to make any internet connections.

Usage

Simple usage:

mangaconv path/to/my/manga.zip another/path/to/my/manga/dir

Configure with flags:

mangaconv -height 1080 -width 1920 path/to/my/manga.zip another/path/to/my/manga/dir

To learn about provided flags:

mangaconv -help

TODOS

This project is still a work in progress.

Notable missing features include:

  • epub input / output support
  • pdf input support
  • memory usage optimization

License

MIT. See LICENSE.

Wikipe-tan image used for testing by Kasuga~enwiki, borrowed from wikimedia under CC BY-SA 3.0.

Documentation

Overview

package mangaconv provides utilities to convert manga and other comics for reading on an e-reader.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedFormat = errors.New("unsupported format")
	ErrCannotReadPath    = errors.New("cannot read path")
)

Functions

This section is empty.

Types

type Converter added in v0.1.2

type Converter struct {
	// contains filtered or unexported fields
}

Converter converts manga for reading on an e-reader. It's safe to use concurrently.

func New added in v0.1.2

func New(p Params) *Converter

New creates a new Converter with the provided Params.

func (*Converter) Convert added in v0.1.2

func (c *Converter) Convert(in, out string) error

Convert reads a file from in, converts it, and writes to out.

func (*Converter) ConvertToWriter added in v0.1.2

func (c *Converter) ConvertToWriter(in string, out io.Writer) error

Convert reads a file from in, converts it, and writes to an io.Writer.

type Params

type Params struct {
	Cutoff float64
	Gamma  float64
	Height int
	Width  int
}

Params adjust how each page of a manga is transformed. For sane defaults, see cmd/mangaconv.

Cutoff is the % of brightest and darkest pixels ignored when applying histogram normalization. Gamma is the multiplier by which an image is darkened or brightened. Values > 1 brighten and values < 1 darken it, with 1 leaving the image as is. Height and Width describe a bounding box in which the output image will be fit.

Directories

Path Synopsis
cmd
Package imgutil implements a set of image processing utilities.
Package imgutil implements a set of image processing utilities.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL