A cross platform reloading image viewer combined with a command executor

Overview

Watchout

A cross platform reloading image viewer combined with a command executor.

Watchout will do any of the following:

  • Run a command when any file in a set of Paths changes. After the command is done running, it will reload and display an image. Imagine you're working on a SQL query to generate a chart. Whenever you save the SQL file Watchout would run a specific command (say generate-chart.py query.sql) and upon completion would reload the image that was generated by generate-chart.py.
  • Check if an image on disk changed and if that is the case re-display the image.

Watchout should run cross platform, but it has only been tested on macOS.

Demo

watchout.mov

(In this demo you can see watchout running cargo run --example image whenever the image.rs file is saved. The image example writes output.png to disk which is displayed by watchout.

Usage

Watchout has to be started from the terminal, quick example:

watchout image -img /path/to/image.png

This will start watchout with an image and redisplay the image if it changes.

Running with a command. Below will run cargo run --example generate_image whenever anything in /proj/bam/src or /proj/bam/examples changes. Once it finished running, it will reload /proj/bam/output.png.

watchout command-image -c "cargo run --example generate_image" -w /proj/bam/src -w /proj/bam/examples -i /proj/bam/output.png

There's another mode where the output of the cmd can define the image to be displayed. In this case, the last line of output from cmd should only be the path to the image that is to be displayed:

watchout command-output -c "cargo run --example generate_image" -w /proj/bam/src

In this example, whenever /proj/bam/src changes, watchout will run cargo run --example generate_image and then take the last line of output from running cargo run --example generate_image, interpret that as the path to an image, and load that image.

Full Usage

USAGE:
    watchout [SUBCOMMAND]

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    command-image     Perform [cmd] when the [watch] folder (recursively) changes and then
                      reload [img]
    command-output    Perform [cmd] when the [watch] folder (recursively) changes and then
                      reload the image at the path in the last line of the [cmd] output
    help              Print this message or the help of the given subcommand(s)
    image             Reload [img] when it changes

Building

cargo build --release

If you want your executable to have a proper icon, you can use cargo bundle (cargo install cargo-bundle):

cargo bundle --release

Or, on macOS

./build_mac.sh

Todo

  • Better error handling (e.g. displaying an error)
  • Allow manually reloading an image / running the command
  • Allow zooming / panning of the image
  • Show the log output in the app

Libraries

Watchout was build using these fine libraries

You might also like...
tai (Terminal Ascii Image) tool to convert images to ascii written in Rust
tai (Terminal Ascii Image) tool to convert images to ascii written in Rust

TAI Terminal Ascii Image A tool to convert images to ascii art written in Rust 🦀 Notes This tool is still in development stage. Contributions All Con

Artsy pixel image to vector graphics converter
Artsy pixel image to vector graphics converter

inkdrop inkdrop is an artsy bitmap to vector converter. Command line interface The CLI binary is called inkdrop-cli and reads almost any image bitmap

Automated image compression for efficiently distributing images on the web.

Imager Apparently this project made it into the GitHub Archive Program. About Imager is a tool for automated image compression, and can competitively

Open Graphic Image Writer
Open Graphic Image Writer

Open Graphic Image Writer Documentation You can generate Open Graphic Image dynamically. A CSS-like API. You can generate image by using template imag

A simple image average color extractor written in 🦀 Rust

A simple image average color extractor written in 🦀 Rust

A Simple Image to Ascii converter in Rust
A Simple Image to Ascii converter in Rust

Image to Ascii A Simple Image to Ascii converter in Rust Brief 📖 In my way to learn Rust i decided to make this converter. Challenges 🐢 new to Rust

Rust library for fast image resizing with using of SIMD instructions.

fast_image_resize Rust library for fast image resizing with using of SIMD instructions. CHANGELOG Supported pixel formats and available optimisations:

Experimental vectorized-raster image editor

Sverg Sverg is an experimental image editor that leverages the power of modern hardware so that you can create images as if they were raster images (e

Rust port of the Quite Okay Image format

qoi_rs What is this? A pretty boring Rust translation of qoi. Status What's there Encode & Decode works Results agree with the C implementation for al

Owner
Benedikt Terhechte
Benedikt Terhechte
Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes

What is Lust? Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes with scaling in mind.

Harrison Burt 242 Dec 22, 2022
Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!

Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!

Jacob 258 Dec 30, 2022
Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD

Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD. It is an experimental project built from the ground up, including new libraries for parsing and triangulation.

null 160 Jan 3, 2023
Signed distance field font and image command line tool based on OpenCL.

SDFTool Signed distance field font and image command line tool based on OpenCL. Build Windows Run cargo build --release in Visual Studio developer x64

弦语蝶梦 7 Oct 16, 2022
A simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art version constructed with emoji

EmojiPix This is a simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art vers

Michael Milton 22 Dec 6, 2022
A Simple-to-use, cross-platform Rust Webcam Capture Library

Cross Platform Rust Library for powerful Webcam Capture and Virtual Webcams

null 246 Jan 8, 2023
Screen-capturer: A cross-platform screenshots library for MacOS、Windows、Linux(X11).

Screen-capturer: A cross-platform screenshots library for MacOS、Windows、Linux(X11).

nashaofu 49 Dec 12, 2022
A cross-platform tool for embedding GPS data into photographs

nya-exif 中文 | English 介绍 nya-exif 是一个用于匹配照片 GPS 信息, 并写入文件 EXIF 信息的工具, 支持 JPEG 和 PNG 及各大相机厂商的主流RAW格式. 本工具基于 Rust 编写, 支持全平台使用 Features 支持 JPEG 和 PNG 及各大

Lyn Chen 32 Nov 16, 2023
Image processing operations

imageproc An image processing library, based on the image library. There may initially be overlap between the functions in this library and those in i

image-rs 512 Jan 8, 2023
Image Compression Algorithm

Image Compression Algorithm ?? A new lossless image compression algorithm. In the newest version the algorithm performs rather good, but manages to su

Hannes 31 May 10, 2022