Image processing utilities for ASIMOV β read, view, and write images with JSON-LD output for seamless knowledge integration.
- Read images and emit JSON-LD (know::Image)
- View streamed JSON-LD image frames in a window
- Save JSON-LD images into multiple formats (PNG, JPEG, BMP, etc.)
- Proper error handling (sysexits) and tracing
- Full support for pipelines and CLI workflows
- Rust 1.85+ (2024 edition) if building from source code
Installation with the ASIMOV CLI
asimov module install image -vcargo install asimov-image-moduleRead a file
asimov-image-reader ./photo.jpgResize before emitting
asimov-image-reader ./photo.jpg --size 800x600Read from stdin
cat photo.jpg | asimov-image-readerVerbose error output
asimov-image-reader -v /no/such/file.jpg
asimov-image-reader -vv /no/such/file.jpgNotes
- Reader emits one JSON object per line.
- Format is inferred from bytes, not extension.
- Errors use POSIX sysexits for safe pipelines.
- Use -v, -vv, -vvv, or --debug for more detail.
View a single image
asimov-image-reader ./photo.jpg | asimov-image-viewerResize before viewing
asimov-image-reader ./photo.jpg --size 800x600 | asimov-image-viewerPowerShell (Windows)
asimov-image-reader .\photo.jpg | asimov-image-viewerView a stream of images
for f in imgs/*.jpg; do
asimov-image-reader "$f"
done | asimov-image-viewerTee JSON-LD while viewing (debugging pipelines)
asimov-image-reader ./photo.jpg \
| asimov-image-viewer --union \
| jq .Notes
- The viewer auto-resizes to each incoming frame.
- Input must match know::Image shape (width, height, data).
- Closes with ESC.
Save a single image
asimov-image-reader ./photo.jpg | asimov-image-writer out/photo.pngResize then save
asimov-image-reader ./photo.jpg --size 800x600 \
| asimov-image-writer out/photo-800x600.jpgSave to multiple files
asimov-image-reader ./photo.jpg \
| asimov-image-writer out/img.png out/img.jpg out/img.bmpTee JSON-LD while saving
asimov-image-reader ./photo.jpg \
| asimov-image-writer --union out/photo.png \
| jq .From stdin
cat photo.jpg | asimov-image-reader | asimov-image-writer out/photo.pngWindows (PowerShell)
asimov-image-reader .\photo.jpg | asimov-image-writer .\out\photo.png
asimov-image-reader -s 640x360 .\photo.jpg | asimov-image-writer .\out\photo-640x360.jpgNotes
- File format is inferred from extension.
- Parent directories are created automatically.
- Invalid image data produces structured errors.
This module requires no configuration.
asimov-image-readerβ decodes images β emits JSON-LDasimov-image-viewerβ displays streamed JSON-LD framesasimov-image-writerβ saves JSON-LD frames to file(s)
Usage: asimov-image-viewer [OPTIONS]
Options:
-U, --union Copy stdin to stdout (tee)
-v, --verbose Increase logging (repeatable)
--debug Enable debug output
--license Show license
-V, --version Show version
-h, --help Show help
Usage: asimov-image-reader [OPTIONS] [URL]
Options:
-s, --size <WxH> Resize image before emitting (e.g. 1920x1080)
-v, --verbose Increase logging
--debug Enable debug output
--license Show license
-V, --version Show version
-h, --help Show help
Usage: asimov-image-writer [OPTIONS] [FILES]...
Arguments:
[FILES]... Output files. Each image is written to all paths. Format is
inferred from the extension (.png, .jpg, .bmp)
Options:
-U, --union Copy stdin to stdout (tee)
-v, --verbose... Increase logging (repeatable)
--debug Enable debug output
--license Show license
-V, --version Show version
-h, --help Show help
git clone https://github.com/asimov-modules/asimov-image-module.git