img-timeline is an installable CLI for turning image frame sequences or videos into timeline images.
pip install -e .img-timeline build <input_path> <output_file>Options:
--intermediate-dir <dir>: also write 1px strip images.--output-format {tiff,png}: choose output format (default TIFF unless output filename is.png).--mode {average,flow}: choose row extraction mode (averagedefault).--flow-profile {exact,fast}: choose flow extraction profile (exactdefault).--workers <n>: number of worker processes. If omitted,flowmode auto-parallelizes for larger inputs.--cuda: enable CUDA acceleration forflowmode (NVDEC decode + CuPy strip compute when available).--dither {none,floyd-steinberg}: apply 16-color Floyd-Steinberg dithering to final output.--palette-color <#RRGGBB>(repeat 16 times): custom palette for dithering.--progress: show progress bars (requirestqdm).
For video inputs, frames are decoded and consumed in memory through a bounded frame buffer before
timeline row generation. This introduces backpressure so extraction/decode cannot run far ahead of
processing. If ffprobe is unavailable, processing falls back to temporary on-disk frame extraction.
With --cuda in flow mode, decode and strip compute are pipelined for overlap. If NVDEC does not
support the source stream profile, decode falls back to software while CUDA strip computation stays on.
img-timeline convert <input_folder> <output_folder> [--output-format tiff|png] [--mode average|flow] [--flow-profile exact|fast] [--workers N] [--cuda]img-timeline stack <input_folder> <output_file> [--output-format tiff|png] [--dither none|floyd-steinberg] [--palette-color #RRGGBB ...] [--progress]img-timeline generate-demo <output_dir> [--count 500] [--size 2]img-timeline build ./frames ./out/timeline.tif --progress
img-timeline build ./movie.mp4 ./out/timeline.png --output-format png --progress
img-timeline build ./red.mkv ./out/red_flow.png --mode flow --output-format png --progress
img-timeline build ./red.mkv ./out/red_flow_cuda.png --mode flow --output-format png --cuda --progress
img-timeline build ./red.mkv ./out/red_flow_dithered.png --mode flow --output-format png --dither floyd-steinberg --progressThese still work for compatibility:
python3 tif_pipeline.py ...python3 tif_convert.py ...python3 tif_stacker.py ...python3 generate_rainbow_tiffs.py ...
- Raises
FileNotFoundErrorif the input path does not exist. - Raises
ValueErrorif no supported image files are found in an input folder. - Raises
RuntimeErrorfor video input ifffmpegis not installed. - Raises
RuntimeErrorif ffmpeg extraction fails.
- Output format is RGB TIFF/PNG by default.
- With
--dither floyd-steinberg, finalbuild/stackoutput is indexed paletted image (P) using 16 colors. - Ordering is sorted lexical filename order.
- Timeline output has one row per source frame.
flow+--cudauses a fixed-bin GPU histogram/reduction path that preserves current flow scoring behavior.- CUDA flow accumulation uses a dedicated kernel for histogram/sum passes (instead of scatter-add primitives).
- Single-worker CUDA video flow processes frames in bounded batches to improve throughput without changing output ordering.
- For unsupported hardware decode cases, fallback decode is automatic and does not disable CUDA strip compute.