An advanced image processing application that transforms regular photographs into cartoon-style images using computer vision techniques.
- Multiple Edge Detection Methods: Choose between Canny, Sobel, or Laplacian algorithms
- Bilateral Filtering: Preserve edges while smoothing textures
- Intelligent Color Quantization: K-means or uniform color reduction
- Real-time Parameter Adjustments: See changes as you make them
- Style Presets: Pre-configured settings for different cartoon styles
- Comparison Views: Side-by-side and process step visualization
- Batch Processing: Process multiple images with the same settings
- Clone this repository:
git clone https://github.com/taimoorkhan10/CartoonFilter.git
cd CartoonFilter- Install required packages:
pip install -r requirements.txtTo start the main application with full features:
python main.pyFor batch processing or automation:
python cli.py -i input_image.jpg -o output_image.pngUse python cli.py --help for more options and parameters.
The cartoon effect is created through several image processing steps:
- Edge Detection: Identifies boundaries in the image using advanced algorithms
- Bilateral Filtering: Smooths the image while preserving important edges
- Color Quantization: Reduces the number of colors to create flat regions
- Color Enhancement: Adjusts saturation to create vibrant cartoon-like colors
The combination of these techniques creates a customizable cartoon effect.
app.py- Main GUI applicationcartoon_filter.py- Core image processing functionalitypreset_loader.py- Handles saving and loading style presetsmain.py- Application entry pointcli.py- Command-line interfaceutils.py- Helper functions and utilitiespresets.json- Pre-defined style configurations
- Default: Balanced cartoon effect
- Bold Lines: Stronger outlines
- Sketch: Black and white drawing style
- Minimal: Simple style with fewer details
- Vibrant: Bright colors with medium lines
- Comic: Bold comic book style
- Detailed: More details and fine lines
- Smooth: Soft edges with simplified colors
Contributions are welcome! Please feel free to submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV for providing powerful image processing capabilities
- The Python community for excellent documentation and support
- Digital Image Processing researchers for the algorithms that make this possible
Taimoor Khan - GitHub Profile
Made with ❤️ for Digital Image Lab



