Metadata-Version: 2.4
Name: superwand
Version: 0.1.11
Summary: A tool for retheming images and CSS using color palettes and gradients.
Author: Julian Henry
License-Expression: MIT
Project-URL: Homepage, https://github.com/juleshenry/superwand
Project-URL: Bug Tracker, https://github.com/juleshenry/superwand/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pillow
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: scikit-learn
Requires-Dist: flask
Requires-Dist: werkzeug
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

# superwand

![SuperWand Studio](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/studio-preview.png)

Leverage magic wand to breath life to images, especially posterized and vector art images.

## Setup
```bash
pip install .
```

## SuperWand Studio

The SuperWand Studio provides an interactive web interface for real-time image retheming, CSS retheming, and gradient application.

### Running the Studio

Simply run the `superwand` command without applying a theme:
```bash
superwand
```

### Access the UI
Once the server is running, open your browser and navigate to `http://127.0.0.1:5001`.

## CLI Usage

### Apply a Theme
```bash
superwand examples/images/zebra.png -theme Urban
```

#### Arguments
- `image_path`: Path to the input image file (optional if starting studio).
- `-theme`: Theme to apply (Tropical, Urban, Winter, etc.).
- `-k`: Number of regions to identify (default 4).
- `-tolerance`: Color matching tolerance (default 50).
- `-flood`: Apply morphological flood filling.
- `-gradient`: Gradient style (none, auto, vertical, horizontal, radial).
- `-intensity`: Gradient intensity (0.0 to 1.0, default 0.2).
- `--headless`: Run in headless mode without opening the studio.

### Enforce Gradients
```bash
gradient-enforce examples/images/charizard.png --style radial
```

#### Arguments
- `image_path`: Path to the input image.
- `--style`: Direction of gradients (auto, vertical, horizontal).
- `--completeness`: Impacted regions (auto, aggressive, filter).
- `--opacity`: Opacity handling.
- `--intensity`: Gradient dramaticism (0.0 to 1.0, default 0.2).
- `--output`: Path to the output image.


## Gradients
Included: `bottom-up`, `top-down`, `left-right`, `right-left`, `radial`

| | | | | |
| :---: | :---: | :---: | :---: | :---: |
| ![bottom-up](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/gradient_bottom-up_charizard.png) | ![top-down](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/gradient_top-down_charizard.png) | ![left-right](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/gradient_left-right_charizard.png) | ![right-left](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/gradient_right-left_charizard.png) | ![radial](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/gradient_radial_charizard.png) |

## CSS Retheming
Identify color schemes in CSS and replace with a theme.

| Before | After |
| :---: | :---: |
| ![before](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/css/before.png) | ![after](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/css/after_tropical.png) |
| ![menu](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/css/menu.png) | ![menu_tropical](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/css/menu_tropical.png) |

## Color Themes
Themes included:

| Spring | Summer | Winter | Fall | Arctic |
| :---: | :---: | :---: | :---: | :---: |
| ![Spring](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/SpringTheme.jpg) | ![Summer](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/SummerTheme.jpg) | ![Winter](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/WinterTheme.jpg) | ![Fall](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/FallTheme.jpg) | ![Arctic](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/ArcticTheme.jpg) |
| ![Safari](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/SafariTheme.jpg) | ![Urban](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/UrbanTheme.jpg) | ![Neon](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/NeonTheme.jpg) | ![Tropical](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/TropicalTheme.jpg) | ![Paixão](https://raw.githubusercontent.com/juleshenry/superwand/main/src/superwand/assets/themes_jpgs/Paix%C3%A3oTheme.jpg) |

### Example: Charizard

| Spring | Summer | Fall | Winter | Arctic |
| :---: | :---: | :---: | :---: | :---: |
| ![Spring](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Spring_charizard.png) | ![Summer](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Summer_charizard.png) | ![Fall](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Fall_charizard.png) | ![Winter](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Winter_charizard.png) | ![Arctic](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Arctic_charizard.png) |
| ![Safari](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Safari_charizard.png) | ![Urban](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Urban_charizard.png) | ![Neon](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Neon_charizard.png) | ![Tropical](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Tropical_charizard.png) | ![Paixão](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/charizards/Paix%C3%A3o_charizard.png) |

## Gallery

### Rio De Janeiro Skyline
| Original | Arctic | Fall | Neon | Tropical |
| :---: | :---: | :---: | :---: | :---: |
| ![Original](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/erro_xota.jpg) | ![Arctic](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/erro_xota_Arctic.png) | ![Fall](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/erro_xota_Fall.png) | ![Neon](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/erro_xota_Neon.png) | ![Tropical](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/erro_xota_Tropical.png) |

### Austin Ladybird Lake Plankton rendered in [ZIT](https://github.com/juleshenry/zooplankton-image-tool)
| Original | Spring | Summer | Winter | Safari |
| :---: | :---: | :---: | :---: | :---: |
| ![Original](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/plankt_oct19.jpg) | ![Spring](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/plankt_oct19_Spring.png) | ![Summer](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/plankt_oct19_Summer.png) | ![Winter](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/plankt_oct19_Winter.png) | ![Safari](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/plankt_oct19_Safari.png) |

### Me in Rio de Janeiro
| Original | Paixão | Urban | Arctic | Fall |
| :---: | :---: | :---: | :---: | :---: |
| ![Original](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/rio07.jpg) | ![Paixão](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/rio07_Paix%C3%A3o.png) | ![Urban](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/rio07_Urban.png) | ![Arctic](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/rio07_Arctic.png) | ![Fall](https://raw.githubusercontent.com/juleshenry/superwand/main/examples/gallery/rio07_Fall.png) |
