{"id":23962673,"url":"https://github.com/pn-projects/toonify","last_synced_at":"2026-01-30T01:43:43.339Z","repository":{"id":258797002,"uuid":"875712901","full_name":"PN-Projects/toonify","owner":"PN-Projects","description":"A MATLAB app that allows users to upload an image, convert it to a cartoon style, and save the result.","archived":false,"fork":false,"pushed_at":"2024-10-24T12:41:23.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-06T20:53:30.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PN-Projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T16:55:09.000Z","updated_at":"2024-10-24T12:41:27.000Z","dependencies_parsed_at":"2024-10-20T20:58:51.946Z","dependency_job_id":null,"html_url":"https://github.com/PN-Projects/toonify","commit_stats":null,"previous_names":["pn-projects/toonify"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PN-Projects%2Ftoonify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PN-Projects%2Ftoonify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PN-Projects%2Ftoonify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PN-Projects%2Ftoonify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PN-Projects","download_url":"https://codeload.github.com/PN-Projects/toonify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240483765,"owners_count":19808636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-06T20:53:42.264Z","updated_at":"2026-01-30T01:43:43.333Z","avatar_url":"https://github.com/PN-Projects.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎨 Image to Cartoon Converter (Basic Image Processing)\n\nTurn your photos into **cartoon-style images** 🎭 using simple **image processing techniques** — no deep learning required, no dataset needed!  \n\nWe follow the algorithm described in:  \n\u003e **Shruti Kumari Shrivastava, Ruchi Gajjar**  \n\u003e *Image Processing based Image to Cartoon Generation: Reducing complexity of large computation arising from Deep Learning*  \n\u003e IEEE, 2023 International Conference on Computational Intelligence and Sustainable Engineering Solutions (CISES).  \n\u003e [DOI: 10.1109/CISES58720.2023.10183524]  \n\n---\n\n## ✨ Features\n- 🧹 **Noise removal** with Median filter  \n- ✂️ **Edge detection \u0026 enhancement** with Canny + Dilation  \n- 🎨 **Color simplification** with Quantization  \n- 🖼️ Outputs a **cartoon-like image** with bold edges and flat colors  \n- ⚡ **Lightweight**: runs with OpenCV + NumPy, no GPU or training needed  \n\n---\n\n## 🧩 Algorithm Pipeline\nImplementation strictly follows the algorithm proposed in the referenced paper:\n\n1. **Input**: Original RGB image  \n2. **Noise Removal** → Median Filter (removes salt \u0026 pepper noise)  \n3. **Edge Detection** → Convert to grayscale + Canny Edge Detector  \n4. **Edge Enhancement** → Morphological Dilation (thickens lines)  \n5. **Image Smoothing** → Averaging Filter (reduces details for flat colors)  \n6. **Color Quantization** →  \n```\nNewValue = floor(p / (a-b)) * (a+b)\n```\n(with constants `a` and `b` controlling number of color bins)  \n7. **Combine** edges with quantized image → Final cartoon image  \n\n---\n\n## 📸 Example Results\nBelow are the **six outputs** you’ll get when running the code:\n\n| Original | Canny Edges | Thickened Edges |\n|----------|-------------|-----------------|\n| ![Original](images/original.jpg) | ![Edges](images/canny.jpg) | ![Thickened](images/thickened.jpg) |\n\n| Smoothed | Quantized | Final Cartoon |\n|----------|-----------|---------------|\n| ![Smoothed](images/smoothed.jpg) | ![Quantized](images/quantized.jpg) | ![Cartoon](images/cartoon.jpg) |\n\n---\n\n## ⚙️ Installation \u0026 Usage\n\n### Requirements\n- Python 3.8+\n- [OpenCV](https://pypi.org/project/opencv-python/)\n- NumPy\n- Matplotlib\n\nInstall dependencies:\n```bash\npip install opencv-python numpy matplotlib\n\n\n### Run Script\n\n```bash\npython cartoonizer.py\n```\n\nEdit the `image_path` variable in `cartoonizer.py` with your image, e.g.:\n\n```python\nimage_path = \"your_photo.jpg\"\n```\n\nThe output will be saved as:\n\n```\nyour_photo_cartoon.png\n```\n\n---\n\n## 📂 Project Structure\n\n```\n├── cartoonizer.py       # Main Python script\n├── README.md            # Project documentation\n├── images/              # Place before/after examples here\n│   ├── original.jpg\n│   ├── canny.jpg\n│   ├── thickened.jpg\n│   ├── smoothed.jpg\n│   ├── quantized.jpg\n│   └── cartoon.jpg\n\n```\n## 📚 Reference\n\n* Shruti Kumari Shrivastava, Ruchi Gajjar, *Image Processing based Image to Cartoon Generation: Reducing complexity of large computation arising from Deep Learning*, 2023 IEEE CISES.\n  DOI: [10.1109/CISES58720.2023.10183524](https://doi.org/10.1109/CISES58720.2023.10183524)\n\n---\n## Future Updagrades (coming soon)\nA React.js based frontend with proper Anime-like Cartoon generation based on AnimeGAN and other pretrained models\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpn-projects%2Ftoonify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpn-projects%2Ftoonify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpn-projects%2Ftoonify/lists"}