# Vernissage - Image Processing Tool

## Install
```shell
pipx install vernissage
```

## Usage

### Process a single image
```shell
vernissage process input.png output.jpg
```

### Process with custom options
```shell
vernissage process input.png output.jpg \
  --max-size 1080 \
  --border-size 10 \
  --border-color 255,255,255 \
  --output-format JPEG
```

### Batch process multiple images
```shell
vernissage batch input_directory/ output_directory/
```

### Batch process with custom options
```shell
vernissage batch input_directory/ output_directory/ \
  --max-size 800 \
  --border-size 20 \
  --border-color 200,200,200 \
  --output-format PNG
```

## Options

| Option | Short | Default | Description |
|--------|-------|---------|-------------|
| `--max-size` | `-s` | 936 | Maximum size for the largest dimension |
| `--border-size` | `-b` | 72 | Border size in pixels |
| `--border-color` | `-c` | 250,250,250 | Border color as R,G,B values |
| `--output-format` | `-f` | (auto) | Output format (JPEG, PNG, etc.) |
| `--aspect-ratio` | `-a` | (auto) | Target aspect ratio (e.g., '1:1', '16:9') |

## Features

- **Exact sizing**: Final image will be exactly `--max-size` pixels on the largest dimension
- **Smart resizing**: Images are resized to fit within the content area, preserving aspect ratio
- **Border handling**: Border is added around the resized content
- **Format detection**: Automatically detects input format and uses it for output
- **Batch processing**: Process entire directories of images
- **Error handling**: Clear error messages and validation
- **Aspect ratio control**: Change output aspect ratio while preserving original image proportions

## Examples

### Create a 1080px image with 10px white border
```shell
vernissage process photo.jpg result.png --max-size 1080 --border-size 10 --border-color 255,255,255
```

### Process all images in a folder to 800px with gray border
```shell
vernissage batch vacation_photos/ processed/ --max-size 800 --border-size 15 --border-color 200,200,200
```

### Convert format and add border
```shell
vernissage process image.tif output.jpg --output-format JPEG --border-size 25
```

### Convert 3:2 image to square aspect ratio
```shell
vernissage process landscape.jpg square_result.png --max-size 1000 --border-size 20 --aspect-ratio 1:1
```

### Create widescreen 16:9 from 4:3 image
```shell
vernissage process photo.jpg widescreen.jpg --max-size 1200 --border-size 15 --aspect-ratio 16:9
```

### Batch process with custom aspect ratio
```shell
vernissage batch portraits/ social_media/ --max-size 800 --border-size 10 --aspect-ratio 4:5 --output-format JPEG
```