# Inkscape Vector Graphics Tools - Claude Desktop Extension

A powerful Claude Desktop extension that provides natural language access to Inkscape's vector graphics capabilities. Convert PNG images to clean SVG vectors, generate text-based graphics, resize and manipulate vector files, and more—all through simple conversational commands.

## 🎯 Features

- **PNG to SVG Conversion**: Transform raster images into clean, scalable vector graphics
- **Text-based SVG Generation**: Create custom SVG graphics with embedded text and styling
- **SVG Resizing**: Resize vector graphics while maintaining quality and aspect ratio
- **SVG Information Extraction**: Get detailed information about SVG files including dimensions and element counts
- **SVG Optimization**: Reduce file sizes and improve performance of vector graphics
- **Cross-platform Support**: Works on Windows, macOS, and Linux
- **Natural Language Interface**: Use conversational commands like "Convert this image to SVG" or "Make an SVG that says 'Hello World'"

## 🚀 Quick Start

### Prerequisites

1. **Claude Desktop**: Download and install [Claude Desktop](https://claude.ai/download)
2. **Inkscape**: Install Inkscape on your system:
   - **Windows**: Download from [inkscape.org](https://inkscape.org/release/) or use `winget install Inkscape.Inkscape`
   - **macOS**: Download from [inkscape.org](https://inkscape.org/release/) or use `brew install inkscape`
   - **Linux**: Use your package manager (e.g., `sudo apt install inkscape` on Ubuntu)

### Installation

1. **Download the Extension**: Get the latest `.dxt` file from the [Releases](https://github.com/PowerUpSkills/claude-inkscape-extension/releases) page
2. **Install in Claude Desktop**:
   - Open Claude Desktop
   - Go to Settings → Extensions
   - Drag and drop the `.dxt` file into the Extensions window
   - Click "Install" when prompted
3. **Configure the Extension**:
   - Set your working directory (where files will be saved)
   - Optionally specify a custom Inkscape path if auto-detection fails
   - Choose your preferred logging level

## 💬 Usage Examples

Once installed, you can use natural language commands to perform vector graphics operations:

### Converting Images to SVG

```
"Convert the file logo.png to SVG format"
"Vectorize this image using edge detection"
"Turn my photo.jpg into a clean SVG"
```

### Creating Text-based Graphics

```
"Create an SVG that says 'Welcome to Our Website'"
"Make a logo with the text 'PowerUp Skills' in blue"
"Generate an SVG with 'Hello World' in 32px Arial font"
```

### Resizing and Manipulating SVGs

```
"Resize this SVG to 1024x768 pixels"
"Make this vector graphic 500 pixels wide"
"Optimize this SVG file to reduce its size"
```

### Getting Information

```
"What are the dimensions of this SVG file?"
"Tell me about the elements in this vector graphic"
"How big is this SVG file?"
```

## 🛠️ Available Tools

The extension provides the following tools that Claude can use:

### `convert_png_to_svg`
Converts PNG, JPG, or other raster images to SVG vector format using Inkscape's tracing capabilities.

**Parameters:**
- `input_path`: Path to the input image file
- `output_path`: Optional output path for the SVG file
- `trace_mode`: Tracing algorithm ("brightness", "edge", "quantized", "multicolor")

### `create_text_svg`
Creates SVG files with custom text content and styling.

**Parameters:**
- `text`: Text content to include
- `font_size`: Font size in pixels (default: 24)
- `font_family`: Font family name (default: "Arial")
- `color`: Text color in hex format (default: "#000000")
- `width`: Canvas width (default: 400)
- `height`: Canvas height (default: 100)

### `resize_svg`
Resizes SVG files to specified dimensions.

**Parameters:**
- `input_path`: Path to the input SVG file
- `width`: Target width in pixels
- `height`: Target height in pixels
- `maintain_aspect`: Whether to maintain aspect ratio (default: true)

### `get_svg_info`
Extracts detailed information about SVG files.

**Parameters:**
- `input_path`: Path to the SVG file

### `optimize_svg`
Optimizes SVG files for smaller size and better performance.

**Parameters:**
- `input_path`: Path to the input SVG file
- `remove_metadata`: Whether to remove metadata (default: true)
- `simplify_paths`: Whether to simplify path elements (default: true)

## 🔧 Configuration

The extension can be configured through Claude Desktop's extension settings:

- **Inkscape Path**: Specify a custom path to the Inkscape executable (leave empty for auto-detection)
- **Working Directory**: Choose where temporary files and outputs will be stored
- **Log Level**: Set the verbosity of logging (DEBUG, INFO, WARNING, ERROR)

## 🐛 Troubleshooting

### Inkscape Not Found
If you see "Inkscape not found" errors:

1. **Verify Installation**: Make sure Inkscape is properly installed
2. **Check PATH**: Ensure Inkscape is in your system PATH, or specify the full path in settings
3. **Manual Path**: In the extension settings, provide the full path to the Inkscape executable:
   - Windows: `C:\Program Files\Inkscape\bin\inkscape.exe`
   - macOS: `/Applications/Inkscape.app/Contents/MacOS/inkscape`
   - Linux: `/usr/bin/inkscape`

### Permission Issues
If you encounter permission errors:

1. **Working Directory**: Ensure the working directory is writable
2. **File Permissions**: Check that input files are readable
3. **Antivirus**: Some antivirus software may block file operations

### Poor Conversion Quality
For better PNG to SVG conversion results:

1. **Use High-Resolution Images**: Start with high-quality, high-resolution source images
2. **Try Different Trace Modes**: Experiment with "brightness", "edge", "quantized", or "multicolor"
3. **Clean Source Images**: Remove noise and artifacts from source images before conversion

## 🏗️ Development

### Building from Source

1. **Clone the Repository**:
   ```bash
   git clone https://github.com/PowerUpSkills/claude-inkscape-extension.git
   cd claude-inkscape-extension
   ```

2. **Install Dependencies**:
   ```bash
   pip install -r src/server/requirements.txt
   ```

3. **Build the Extension**:
   ```bash
   python build.py
   ```
   Or use the Makefile:
   ```bash
   make build
   ```

4. **Install for Testing**:
   Drag the generated `.dxt` file from the `dist/` directory into Claude Desktop.

### Project Structure

```
claude-inkscape-extension/
├── src/
│   ├── manifest.json          # Extension metadata and configuration
│   ├── server/
│   │   ├── main.py           # Main entry point
│   │   ├── inkscape_tools.py # Core Inkscape functionality
│   │   ├── requirements.txt  # Python dependencies
│   │   └── utils/
│   │       ├── inkscape_detector.py  # Cross-platform Inkscape detection
│   │       └── logging_config.py     # Logging configuration
│   └── assets/
│       └── icon.png          # Extension icon
├── build.py                  # Build script
├── Makefile                  # Build automation
└── README.md                 # This file
```

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

## 📞 Support

- **Issues**: [GitHub Issues](https://github.com/PowerUpSkills/claude-inkscape-extension/issues)
- **Discussions**: [GitHub Discussions](https://github.com/PowerUpSkills/claude-inkscape-extension/discussions)
- **Email**: jaydee.powerupskills@gmail.com

## 🙏 Acknowledgments

- [Anthropic](https://anthropic.com) for Claude Desktop and the MCP protocol
- [Inkscape](https://inkscape.org) for the powerful vector graphics engine
- The open-source community for inspiration and tools

---

**Made with ❤️ by PowerUpSkills**

## 🎬 Demo Videos

### Basic Usage
Watch how to install and use the extension for common tasks:

1. **Installation**: [Coming Soon]
2. **PNG to SVG Conversion**: [Coming Soon]
3. **Text SVG Creation**: [Coming Soon]
4. **Advanced Features**: [Coming Soon]

## 🔄 Version History

### v1.0.0 (Current)
- Initial release
- PNG to SVG conversion with multiple tracing modes
- Text-based SVG generation
- SVG resizing and optimization
- Cross-platform Inkscape detection
- Comprehensive error handling and logging

## 🗺️ Roadmap

### Planned Features
- **SVG Combining**: Merge multiple SVG files into one
- **Advanced Styling**: More text styling options (gradients, shadows, etc.)
- **Batch Processing**: Process multiple files at once
- **Template System**: Pre-built SVG templates for common use cases
- **Export Options**: Export SVG to PNG, PDF, and other formats
- **Interactive Preview**: Preview SVG files before saving

### Community Requests
Have an idea for a new feature? [Open an issue](https://github.com/PowerUpSkills/claude-inkscape-extension/issues) and let us know!
