{"id":16162396,"url":"https://github.com/sunsided/opencv-cartoon-effect","last_synced_at":"2026-04-27T01:31:42.695Z","repository":{"id":177938967,"uuid":"661117433","full_name":"sunsided/opencv-cartoon-effect","owner":"sunsided","description":"A cartoon effect with OpenCV in Rust","archived":false,"fork":false,"pushed_at":"2024-05-11T14:37:42.000Z","size":520,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T06:50:52.457Z","etag":null,"topics":["cartoonify","cartoonization","comic","dithering-images","halftone","image-processing","opencv","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-07-01T21:01:55.000Z","updated_at":"2024-05-11T14:37:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"73f3ddc3-3109-4937-9743-c0fbec839c30","html_url":"https://github.com/sunsided/opencv-cartoon-effect","commit_stats":null,"previous_names":["sunsided/opencv-cartoon-effect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sunsided/opencv-cartoon-effect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cartoon-effect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cartoon-effect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cartoon-effect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cartoon-effect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/opencv-cartoon-effect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cartoon-effect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32319559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cartoonify","cartoonization","comic","dithering-images","halftone","image-processing","opencv","rust"],"created_at":"2024-10-10T02:29:58.875Z","updated_at":"2026-04-27T01:31:42.676Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Faux cartoon effect with OpenCV\n\nCommon tutorials around the web suggest that cartoon filters can be easily done by using [median blurring](https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9),\nadaptive thresholding and edge detection. While this works, it achieves sub-par results almost certainly.\n\nThis approach replaces median blurring\nwith [anisotropic diffusion](https://docs.opencv.org/3.4/df/d2d/group__ximgproc.html#gaffedd976e0a8efb5938107acab185ec2)\nand uses [edge dilation](https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c)\nfor more natural looking \"strokes\", as well as\n[pyramid mean shift filtering](https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga9fabdce9543bd602445f5db3827e4cc0)\nfor color reduction to achieve a more comic-like effect.\n\n\u003cdiv align=\"center\" style=\"text-align: center\"\u003e\n    \u003cimg src=\"readme/cartoonify.jpg\" alt=\"Cartoonified Grumpy Cat\" /\u003e\n\u003c/div\u003e\n\nThis, of course, also only works with proper tuning of the parameters.\n\nHere's the input image and the produced result for comparison. An alternative print-like faux-CMYK half-toning step was\nadded using the [rotated-grid](https://github.com/sunsided/rotated-grid) crate;\nto play around with that, simply run the code with `--features=halftone`.\n\n| Input               | Output                       | Halftoned                 |\n|---------------------|------------------------------|---------------------------|\n| ![](grumpy-cat.jpg) | ![](readme/cartoonified.jpg) | ![](readme/halftoned.jpg) |\n\nYMMV. 🐱\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fopencv-cartoon-effect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fopencv-cartoon-effect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fopencv-cartoon-effect/lists"}