{"id":21590547,"url":"https://github.com/anishlearnstocode/image2sketch","last_synced_at":"2025-07-22T16:06:56.536Z","repository":{"id":98362277,"uuid":"311937856","full_name":"anishLearnsToCode/image2sketch","owner":"anishLearnsToCode","description":"Converts a 2D Color Image 🖼 into a Hand drawn Sketch ✏ Using Novel Technique.","archived":false,"fork":false,"pushed_at":"2021-01-15T19:06:32.000Z","size":53813,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T22:34:37.650Z","etag":null,"topics":["computer-vision","cv","digital-image-processing","dip","image-processing"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anishLearnsToCode.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,"zenodo":null}},"created_at":"2020-11-11T10:33:25.000Z","updated_at":"2025-02-04T13:28:23.000Z","dependencies_parsed_at":"2023-04-06T08:04:46.380Z","dependency_job_id":null,"html_url":"https://github.com/anishLearnsToCode/image2sketch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anishLearnsToCode/image2sketch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishLearnsToCode%2Fimage2sketch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishLearnsToCode%2Fimage2sketch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishLearnsToCode%2Fimage2sketch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishLearnsToCode%2Fimage2sketch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anishLearnsToCode","download_url":"https://codeload.github.com/anishLearnsToCode/image2sketch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishLearnsToCode%2Fimage2sketch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266524998,"owners_count":23942853,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["computer-vision","cv","digital-image-processing","dip","image-processing"],"created_at":"2024-11-24T16:19:06.018Z","updated_at":"2025-07-22T16:06:56.523Z","avatar_url":"https://github.com/anishLearnsToCode.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image 2 Sketch\n\n📃 [Report](assets/image-2-sketch-report.pdf) |\n📓 [Explanation Notebook with Code](notebook/novel-method-explanation.ipynb) |\n⭐ [Results](#a-few-results)\n\n![lenna-example](assets/lenna-results.png)\n\n## 📖 Overview\n1. [Introduction](#introduction)\n1. [Current Method](#current-method)\n1. [My Method (Novel Idea)](#novel-method)\n1. [A Few Results](#a-few-results)\n1. [Running it On Your Machine](#running-it-on-your-machine)\n1. [Bibliography](#bibliography)\n\n## Introduction\nThere are several methods to extract edges from images. There are also several other \nmethods for object detection and region segmentation. In this project I propose a novel\nmethod for Feature extraction from Images and use this method to create sketch composite\nfor the given Image.\n\n## Current Method\nThe current State of the art method is the Gaussian Blur-Blend Method which has \nthe following algorithm:\n\n```python\ndef gaussian_blend_blur(I: image, k: Kernel Size):\n    J = grayscale_of_image(I)\n    K = gaussian_kernel_of_size(k, k)\n    B = gaussian_blur_of_image_with_kernel(J, K)\n    result = J / B\n    return result\n```\n\n## Novel Method\nWe introduce a new method for feature extraction, the Orthogonal Gaussian Lattice Method\nwhich takes 3 Gaussian and computes teh inverse of the grayscale of the image with \nthese 3 Gaussian and then uses a connectivity bound parameter alpha to create 3 Simple\nGraphs from these inverse gaussian. These graphs are then used to extract Lattices from\nthe image and these lattices are then used as features and for image sketching.\n\nThe algorithm is as follows and for full details please reefr to the\n[Jupyter Notebook with Complete Explanation](notebook/novel-method-explanation.ipynb).\n\n![algorithm-1](assets/algorith-deviations.PNG)\n![algorithm-2](assets/algorith-simple-graph.PNG)\n![algorithm-3](assets/algorith-lattices.PNG)\n![algorithm-4](assets/algorith-vertex-color.PNG)\n![algorithm-5](assets/algorith-result.PNG)\n\n## A Few Results\n![butterfly-result](assets/butterfly-result.png)\n![swiss-1-results](assets/swiss-1-results.png)\n![swiss-2-result](assets/swiss-2.png) \n![dolphin-2-result](assets/dolphin-2-result.png)\n![flower-2-result](assets/flower-2-result.png)\n![flower-rose-result](assets/flower-rose-result.png)\n![swiss-3-result](assets/swiss-3-result.jpg)\n\n## Running it On Your Machine\nThe program requires the following dependencies:\n1. [Python 3](https://www.python.org/)\n1. [pip](https://pip.pypa.io/en/stable/)\n1. [Git](https://git-scm.com/)\n\nClone and install all dependencies:\n```shell script\ngit clone https://github.com/anishLearnsToCode/image2sketch.git\ncd image2sketch\nmkdir results\nmkdir data\npip install -r requirements.txt\n```\n\nTo test this program on some sample images see `src/test.py`. Create a directory \n`/data` under the project root and add some sample images there for testing purposes. \nPreferably add PNG Images as they store full data without compression. Inside \n`src/test.py` set the path to yor image and you can also further change Hyper-parameters\nfrom the file `src/control_parameters.py` and run it as\n\n```shell script\ncd src\npython test.py \n```\n\nResults will be displayed and also saved under the directory `results/{image_name}` \nwhere `image_name` comes from `src/test.py`.\n\n\n## Bibliography\n1. [How to create a beautiful pencil sketch effect with OpenCV and Python ~Ask A Swiss](https://www.askaswiss.com/2016/01/how-to-create-pencil-sketch-opencv-python.html)\n1. [Open CV](https://opencv.org/)\n1. [Python 3](https://www.python.org/)\n1. [Git](https://git-scm.com/)\n1. [Graph Theory and Its Applications to Image Segmentation ~IEEE](https://ieeexplore.ieee.org/document/8389737)\n1. [Image Sketch Online](https://pencilsketch.imageonline.co/index.php)\n1. [Photofunia Sketch Effect](https://photofunia.com/effects/sketch)\n1. [convertimage.net](https://convertimage.net/online-photo-effects/online-photo-drawing-sketch.asp?i=20201111-110144-urqmr)\n1. [Convert Image to GrayScale ~KD Nuggets](https://www.kdnuggets.com/2019/12/convert-rgb-image-grayscale.html#:~:text=An%20intuitive%20way%20to%20convert,into%20a%20reasonable%20gray%20approximation.)\n1. [pip](https://pip.pypa.io/en/stable/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishlearnstocode%2Fimage2sketch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanishlearnstocode%2Fimage2sketch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishlearnstocode%2Fimage2sketch/lists"}