Skip to content

Added a script which generates sketch out of images #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 60 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<sub><b>Noor Ahmed</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Khushi260">
<img src="https://avatars.githubusercontent.com/u/94845508?v=4" width="100;" alt="Khushi260"/>
<br />
<sub><b>Khushi Jha</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/muratonuryildirim">
<img src="https://avatars.githubusercontent.com/u/77264793?v=4" width="100;" alt="muratonuryildirim"/>
Expand All @@ -122,21 +129,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Vallabh Chugh</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Abbhiishek">
<img src="https://avatars.githubusercontent.com/u/86338762?v=4" width="100;" alt="Abbhiishek"/>
<br />
<sub><b>Abhishek Kushwaha</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Khushi260">
<img src="https://avatars.githubusercontent.com/u/94845508?v=4" width="100;" alt="Khushi260"/>
<br />
<sub><b>Khushi Jha</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/yunghog">
Expand Down Expand Up @@ -252,14 +252,21 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<sub><b>Prajwol Shrestha</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/NishantPacharne">
<img src="https://avatars.githubusercontent.com/u/71060551?v=4" width="100;" alt="NishantPacharne"/>
<br />
<sub><b>Nishant Pacharne</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/ighoshsubho">
<img src="https://avatars.githubusercontent.com/u/93722719?v=4" width="100;" alt="ighoshsubho"/>
<br />
<sub><b>Null</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/Dishant10">
<img src="https://avatars.githubusercontent.com/u/84343829?v=4" width="100;" alt="Dishant10"/>
Expand Down Expand Up @@ -294,15 +301,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Tiya Gupta</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/avyayjain">
<img src="https://avatars.githubusercontent.com/u/63355322?v=4" width="100;" alt="avyayjain"/>
<br />
<sub><b>Avyay Jain</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/devtayade">
<img src="https://avatars.githubusercontent.com/u/84332795?v=4" width="100;" alt="devtayade"/>
Expand Down Expand Up @@ -337,15 +344,22 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Null</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/smeax">
<img src="https://avatars.githubusercontent.com/u/114774652?v=4" width="100;" alt="smeax"/>
<br />
<sub><b>Null</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tolgakurtuluss">
<img src="https://avatars.githubusercontent.com/u/22731161?v=4" width="100;" alt="tolgakurtuluss"/>
<br />
<sub><b>Null</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/srinjoy-26">
<img src="https://avatars.githubusercontent.com/u/91176055?v=4" width="100;" alt="srinjoy-26"/>
Expand All @@ -367,28 +381,21 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<sub><b>Shradha</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/NishantPacharne">
<img src="https://avatars.githubusercontent.com/u/71060551?v=4" width="100;" alt="NishantPacharne"/>
<br />
<sub><b>Nishant Pacharne</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/thegeekyb0y">
<img src="https://avatars.githubusercontent.com/u/84658112?v=4" width="100;" alt="thegeekyb0y"/>
<br />
<sub><b>Aditya Tiwari</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/BassCoder2808">
<img src="https://avatars.githubusercontent.com/u/65075935?v=4" width="100;" alt="BassCoder2808"/>
<br />
<sub><b>Vedant Jolly</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/Hemant2801">
<img src="https://avatars.githubusercontent.com/u/87967889?v=4" width="100;" alt="Hemant2801"/>
Expand Down Expand Up @@ -423,15 +430,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Rahul Kumar</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/riyaroy2086">
<img src="https://avatars.githubusercontent.com/u/89868832?v=4" width="100;" alt="riyaroy2086"/>
<br />
<sub><b>Riya Roy</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/royninja">
<img src="https://avatars.githubusercontent.com/u/26019882?v=4" width="100;" alt="royninja"/>
Expand Down Expand Up @@ -466,15 +473,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Ambush</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/aswin2108">
<img src="https://avatars.githubusercontent.com/u/72661784?v=4" width="100;" alt="aswin2108"/>
<br />
<sub><b>Aswin Shailajan</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/jrafaaael">
<img src="https://avatars.githubusercontent.com/u/70046023?v=4" width="100;" alt="jrafaaael"/>
Expand Down Expand Up @@ -509,15 +516,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Akash Jain</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Rancho2002">
<img src="https://avatars.githubusercontent.com/u/92109154?v=4" width="100;" alt="Rancho2002"/>
<br />
<sub><b>Arijit Ghosh</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/Yaswanth820">
<img src="https://avatars.githubusercontent.com/u/55750562?v=4" width="100;" alt="Yaswanth820"/>
Expand Down Expand Up @@ -552,15 +559,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Gokul_Zuzu</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/KuSantosh100">
<img src="https://avatars.githubusercontent.com/u/97560663?v=4" width="100;" alt="KuSantosh100"/>
<br />
<sub><b>KUMAR SANTOSH</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/Manice18">
<img src="https://avatars.githubusercontent.com/u/91601706?v=4" width="100;" alt="Manice18"/>
Expand Down Expand Up @@ -595,15 +602,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Ramon Saraiva</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/riyajaiswal25">
<img src="https://avatars.githubusercontent.com/u/84279900?v=4" width="100;" alt="riyajaiswal25"/>
<br />
<sub><b>Riya Jaiswal</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/sarthakroy2002">
<img src="https://avatars.githubusercontent.com/u/47187468?v=4" width="100;" alt="sarthakroy2002"/>
Expand Down Expand Up @@ -638,15 +645,15 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Ansh Rusia</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/arpitbhardwaj">
<img src="https://avatars.githubusercontent.com/u/23013825?v=4" width="100;" alt="arpitbhardwaj"/>
<br />
<sub><b>Arpit Bhardwaj</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/artemis-i-guess">
<img src="https://avatars.githubusercontent.com/u/65388018?v=4" width="100;" alt="artemis-i-guess"/>
Expand Down Expand Up @@ -675,6 +682,14 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<sub><b>Yash Nilesh Brid</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mclmza">
<img src="https://avatars.githubusercontent.com/u/7353871?v=4" width="100;" alt="mclmza"/>
<br />
<sub><b>Michele Mazza</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/mer747">
<img src="https://avatars.githubusercontent.com/u/84189502?v=4" width="100;" alt="mer747"/>
Expand All @@ -688,8 +703,7 @@ Thanks a lot for spending your time helping! Keep rocking 🍻
<br />
<sub><b>Mubeen Ahmad</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/neocollege">
<img src="https://avatars.githubusercontent.com/u/86466839?v=4" width="100;" alt="neocollege"/>
Expand Down
Binary file added scripts/Img to Sketch/demo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions scripts/Img to Sketch/img-sketch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import cv2

img = cv2.imread('demo.jpg') # enter your image here

grey_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
invert = cv2.bitwise_not(grey_img)

blur = cv2.GaussianBlur(invert, (21, 21), 0)
invertedblur = cv2.bitwise_not(blur)
sketch = cv2.divide(grey_img, invertedblur, scale=256.0)
cv2.imwrite("sketch.png", sketch)

16 changes: 16 additions & 0 deletions scripts/Img to Sketch/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Script to generate sketch
This is a simple python script which uses cv2 to generate sketch out of an image


[input image](demo.jpg)
[output image](sketch.png)

<br/>

#### Get started

`pip install -r requirements.txt`

#### Thats it!

`python img-sketch.py`
2 changes: 2 additions & 0 deletions scripts/Img to Sketch/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy==1.23.4
opencv-python==4.6.0.66
Binary file added scripts/Img to Sketch/sketch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.