Metadata-Version: 2.4
Name: siss
Version: 1.0.0
Summary: A command-line utility for applying artistic effects to videos and still images
Home-page: https://github.com/MichailSemoglou/siss
Author: Michail Semoglou
Author-email: m.semoglou@tongji.edu.cn
License: MIT
Project-URL: Bug Reports, https://github.com/MichailSemoglou/siss/issues
Project-URL: Source, https://github.com/MichailSemoglou/siss
Keywords: video,duotone,halftone,effect,artistic,video-processing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Artistic Software
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: opencv-python<6.0.0,>=4.10.0
Requires-Dist: numpy<3.0.0,>=1.20.0
Requires-Dist: tqdm<5.0.0,>=4.60.0
Requires-Dist: Pillow<12.0.0,>=11.3.0; python_version < "3.10"
Requires-Dist: Pillow<13.0.0,>=12.3.0; python_version >= "3.10"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Siss

A command-line tool for applying duotone and halftone effects to video and
still-image files. Duotone maps per-pixel luminance to a linear blend between
two user-supplied RGB colors; halftone renders plus, asterisk, slash, or dot
symbols at luminance-proportional sizes over a 3×3-pixel sampled grid, on a
square or hex-offset screen. Accepts hex strings, CSS named colors, RGB triples,
and named two-color palettes.

## Features

- **Duotone** – maps per-pixel luminance to a linear gradient between two RGB colors; `color1` is applied to dark areas, `color2` to light areas
- **Halftone** – renders plus, asterisk, slash, dot, or ring symbols at sizes proportional to local luminance (3x3-pixel sampled average), with independent symbol and background colors, over a square or hex-offset sampling grid, and an optional luminance-curve gamma for non-linear size mapping
- **Color input** – accepts 3- and 6-digit hex strings (with or without `#`), case-insensitive CSS named colors, RGB integer triples, and named two-color palettes via `--palette`
- **Still-image output** – write PNG, JPEG, BMP, TIFF, or WebP by using an image extension for the output path; reuses the same per-frame effect closures as video output
- **Codec selection** – probes `cv2.VideoWriter_fourcc` candidates per output format and OS; falls back through a priority list until a working codec is found
- **Audio passthrough** – copies the original audio track into the output with `ffmpeg` after rendering; disable with `--no-audio`
- **Custom palettes** – load your own two-color looks from a JSON file with `--palette-file`; custom names shadow built-in ones
- **Constraints files** – lock every rendering parameter in a single JSON document with `--constraints`; CLI flags override individual slots. Capture the effective constraints of any run with `--dump-constraints` for reproducible, auditable renders

## Installation

```bash
pip install siss
```

## Quick Start

After installation, run `siss` from the command line:

```bash
siss input_video.mp4 output_video.mp4 --effect duotone
```

To process a still image, use an image extension for the output path:

```bash
siss input.jpg output.png --effect duotone --palette sunset
```

## Specifying Colors

Colors accept hex strings, CSS names, RGB triples, or curated palettes:

```bash
siss input.mp4 output.mp4 --effect duotone --color1 "#3b1f4b" --color2 gold
siss input.mp4 output.mp4 --effect duotone --palette sunset
siss --list-palettes
```

## Example Effects

### Duotone Effect

![Duotone Example](https://raw.githubusercontent.com/MichailSemoglou/siss/main/examples/duotone_example.jpg)

```bash
siss input.mp4 output.mp4 --effect duotone --color1 56 12 45 --color2 217 237 3
```

Applies a duotone effect with deep purple mapped to dark areas and bright yellow-green to light areas.

### Halftone Effect

![Halftone Example](https://raw.githubusercontent.com/MichailSemoglou/siss/main/examples/halftone_example.jpg)

```bash
siss input.mp4 output.mp4 --effect halftone --symbol_type slash --symbol_size 20 --color1 56 12 45 --color2 217 237 3
```

Applies a halftone effect with slash symbols at luminance-proportional sizes.

## Documentation

See the [GitHub repository](https://github.com/MichailSemoglou/siss) for full documentation.

## Requirements

- Python 3.9+
- OpenCV (`cv2`)
- NumPy
- tqdm
- ffmpeg (optional — for audio passthrough)
