Crates.io | cega |
lib.rs | cega |
version | 0.2.2 |
source | src |
created_at | 2024-06-20 17:41:29.187254 |
updated_at | 2024-07-16 07:05:08.31879 |
description | CGA and EGA binary image file processing library |
homepage | |
repository | https://github.com/knzconnor/cega |
max_upload_size | |
id | 1278213 |
size | 86,145 |
This is currently very much in an alpha state: apis and CLI arguments may still change heavily and the apis aren't documented. This file has decent usage examples below.
This can be used as a library or executable.
The binary handles arguments (and thus help) via clap 4
Usage: cega [OPTIONS] <IMAGE>
Arguments:
<IMAGE>
Options:
-a, --ascii-mode <ASCII_MODE> images will horizontally crop to terminal
[possible values: a, c, p, h]
a = plain ascii
c = colored ascii
p = full pixels via ansi bg color
h = horizontal half pixels (UGLY)
-p, --palette [<PALETTE>] ega palette can be used for cga, but not the inverse
[possible values: cga0, cga0i, cga1, cga1i, ega]
-i, --image-parser <IMAGE_PARSER> [default: cga] [possible values: ega_row_planar, erp, cga]
-c, --custom-ascii <CUSTOM_ASCII> 4 or 16 chars palette like -a " +%0"
-w, --width <WIDTH> [default: 320]
-m, --max-width <MAX_WIDTH> used for wrapping rows if retiling with tile_height
-o, --output-file <OUTPUT_FILE> format based on extension - see image crate
-t, --tile-height <TILE_HEIGHT>
-s, --sdl
-q, --quiet
-h, --help Print help
-V, --version Print version
cega can parse output to png, and other formats.
cega can parse tiled/spritesheet style cga and output "pixels" to the terminal
cega ../../assets/game/CGATILES.BIN -w 16 -r 16 -i cga -t p
:
cega will output some suggestions, like if it's not a CGA fullscreen image, but you don't specify tiling:
cega ../../assets/game/CGATILES.BIN -t a
:
cega will ouput in different preview formats, such as colored ASCII or a gui window:
cega ../../assets/game/CGATILES.BIN -w 16 -r 16 -i cga -t c -c "1234" -s
:
default = ["terminal", "sdl2", "png"]
terminal = ["clap"]
png = ["image"]
Disabling terminal will skip the binary target Png feature is handled via image so includes that dep