├── LICENSE ├── README.md ├── dist ├── sketchpy3-0.3.2-py3-none-any.whl └── sketchpy3-0.3.2.tar.gz ├── images └── rdj.jpg ├── setup.py └── sketchpy3 ├── __init__.py ├── canvas.py ├── files └── trace.exe └── library.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Sriram 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to sketchpy 2 | 3 | 4 |
5 | 6 |
7 | 8 | ## Description 9 | 10 | This is the Intermediate level python project to do some awesome drawing animation using the `turtle` module, hope it grows in the future. 11 | It is a Python module for animating drawings of images. The sketchpy module is created on top of the turtle module in Python. 12 | To install sketchpy on your computer, you can go to your command prompt (command line) and run the following command. 13 | 14 | ### Usage 15 | 16 | - Just install the package `pip install sketchpy3` 17 | - Followed by `pip install --upgrade sketchpy3` to update the package to the latest version. 18 | - Import it to you project `import sketchpy3` and use as you want😊 19 | 20 | ### Built with 21 | 22 | - Turtle 23 | - Open-cv 24 | - Pillow 25 | - numpy 26 | - Svgpathtools 27 | 28 | ## Getting started 29 | 30 | ### Lastes version of sketchpy: 0.1.8 31 | 32 | - you can install the latest version with either 33 | ``` 34 | pip install sketchpy3==0.3.1 35 | ``` 36 | or 37 | ``` 38 | pip install sketchpy3 --U 39 | ``` 40 | 41 | ## Updates!! 42 | 43 | - Now uses `AI` to generate different styles of images for sketching using the class `canvas.ai_sketch_from_image` 44 | - You can use the function as followes 45 | ``` 46 | from sketchpy3 import canvas 47 | if __name__ == "__main__": 48 | obj = canvas.ai_sketch_from_image(IMG_PATH,3) 49 | obj.draw() 50 | ``` 51 | 52 | - Sample 53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | - The first image is the `source image`, and the following corresponds to different styles from `[0-3]` 64 | - This version `0.3.1` uses multiprocessing for processing the single svg file in 4 different threads to reduce the time for loading the svg file 65 | - Sample 66 |
67 | 68 |
69 | - And I have included a new function named `get_svg()` from `canvas` to convert your Image to svg, 70 | - You can use the function as followes 71 | ``` 72 | from sketchpy import canvas 73 | canvas.get_svg(img_path) 74 | ``` 75 | - The `get_svg()` function opens a short url only `once` a day. Just enter the 4 digit number from the landing page from the short url in the cmd to access the svg converter. And you need to complete the short url only once a day, So it's no big deal. 76 | 77 | 78 | 79 | ### Prerequisites 80 | 81 | - Python 82 | - Basic text editor 83 | - creativity😂 84 | 85 | ### Install 86 | 87 | ``` 88 | pip install sketchpy3 89 | ``` 90 | it should probably work, If not then try the following code 91 | 92 | ``` 93 | pip install turtle open-cv wheel sketchpy3 94 | ``` 95 | 96 | 97 | # Trace from Image 98 | 99 | The recent version of the package includes a class named `trace_from_image()`, which allowes you to get the same output as using a svg file without the need to convert it to a svg file. hecnce it reduces the run time and it is much effecient. 100 | 101 | - To know more about this new class visit the blog post [here](https://codehub03.blogspot.com/2023/07/how-to-draw-ai-hoshino-with-just-3.html). 102 | - A sample output of the class `trace_from_image()`. 103 | - you can take a view about how the class working in [here](https://youtube.com/shorts/_F23GwUJcIU?feature=share) 104 | 105 | 106 | 107 |
108 | 109 | 110 |
111 | 112 | 113 | Sample Code: 114 | ``` 115 | from sketchpy3 impor canvas 116 | obj = canvas.trace_from_image("Image Path") 117 | obj.draw() 118 | ``` 119 | ### Parameters : 120 | 121 | - Path: Path of the image 122 | - Scale: 123 | -scaling factor for the sketched image, 124 | - less than 1 => smaller than original image 125 | - equal to 1 => original size 126 | - greater than 1 => greater than original image 127 | 128 | - intensity -> intensity of details, keep the value between 0 and 255, optimal value lies between(200 - 255) 129 | - save -> take a screenshot when the program stops sketching, false by default 130 | - details -> use to skip the small details from the image to increase the speed. details=0 -> inculde all minor details, details=50 -> include all details which are greater than 50 131 | - blur -> always provide a odd number, the lower the value the more distortion, higher the value the more smooth, optimal value 51 132 | - skip_frequency -> used to speed the sketchpy the process by skipping some values 133 | 134 | 135 | # Sketch from Image 136 | used to trace the image line by line. 137 | 138 | Example Code : 139 | 140 | ``` 141 | from sketchpy impor canvas 142 | obj = canvas.sketch_from_image("Image Path") 143 | obj.draw(threshold = 127) 144 | ``` 145 | 146 | ### Parameters 147 | - path -> path of the image 148 | - save -> used to same the results 149 | 150 | you can watch the example video from [here](https://www.youtube.com/watch?v=hCRppNooLYE) 151 | #### NOTE: you can change the value of threshold to draw more detailed image, it's range is 0 - 255,use values between 90-190 152 | to know more about it visit [here](https://codehub03.blogspot.com/2022/04/how-to-draw-image-with-python-using.html) 153 | 154 | 155 | # Drawing From `SVG` file 156 | 157 | 158 | You can sketch image uinsg the class `color_sketch_from_svg`, which takes the inpu in svg formate and then sketches it. 159 | Example Code: 160 | ``` 161 | from sketchpy3 impor canvas 162 | if __name__ == "__main__": 163 | obj = canvas.color_sketch_from_svg("Image Path") 164 | obj.draw() 165 | ``` 166 | 167 | Example output 168 | 169 |
170 | 171 |
172 | 173 | #### NOTE: `sketch_from_svg` class is remove from the package, since it can only draw with single color, `color_sketch_from_svg` class will be available. 174 | ### Parameters 175 | - color_sketch_from_svg 176 | - path -> path of the svg file 177 | - no_of_processes -> no of individual branches the process the svg file 178 | - scale -> zoom value 179 | - x_offset -> amount of movemnt in x direction 180 | - y_offset -> amount of movemnt in y direction 181 | - save -> (True by defaule)= take a screenshot and save it 182 | - load_svg 183 | - file_name -> name of the npy array, you can use this array data to sketch images directly 184 | - draw 185 | - retain -> retain the window after sketching (true by defaule) 186 | - file -> file path of the npy file for direct sketching 187 | - data -> raw data, should be a list in [[[x1,y1], [x2,y2], ....], [255,255,255]], first nested list is the points and the second list the color 188 | - x_offset -> amount of movement in x direction while sketching 189 | - y_offset -> amount of movement in y direction while sketching 190 | - scale -> zoom value while sketching 191 | - speed -> speed of sketching 192 | 193 |
194 | 195 | 196 | # Sketching form `.npy` file 197 | 198 | Insted of waiting for the svg file to load, you can saved `.npy` file and use that for future use, 199 | use the following code to draw your image from saved data file 200 | 201 | ``` 202 | from sketchpy3 import canvas 203 | obj = canvas.color_sketch_from_svg(None) 204 | obj.draw(file = 'data.npy') 205 | ``` 206 | 207 |
208 | 209 | # Converting `Image` to `SVG` formate 210 | 211 | Sketchpy3 requires specific type of `SVG` file formate to work properly, hence this version includes a standalone svg converter function with it 212 | use the follow code to convert you images to svg files 213 | 214 | ``` 215 | from sketchpy3 import canvas 216 | canvas.get_svg(IMG_PATH) 217 | ``` 218 | 219 | - It takes the image from the `IMG_PATH` and converts it into an svg file 220 | - But to access this SVG converter you have to complete a shorturl, don't worry you need to do this only once a day 221 | - Use brave browser to complete it with ih 20 sec. 222 | 223 |
224 | 225 | # Converting `Image` to `AI ART` 226 | 227 | - This new version sketchpy3 includes a class named `ai_sketch_from_image` 228 | - This class converts the given imag to different styles of image using `generative art` from bryandlee/animegan2 229 | - You can use it as follows 230 | 231 | ``` 232 | from sketchpy3 import canvas 233 | 234 | if __name__ == "__main__": 235 | obj = canvas.ai_sketch_from_image(IMG_PATH, STYLE_INDEX) 236 | obj.draw() 237 | ``` 238 | ### Use the following code to get the AI ART as image 239 | 240 | ``` 241 | from sketchpy3 import canvas 242 | obj = canvas.ai_sketch_from_image(IMG_PATH, STYLE_INDEX) 243 | obj.convert_image() 244 | ``` 245 | - You can find your output image as `source.jpg` file 246 | 247 | ### Example 248 | 249 |
250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 |
259 | 260 | 261 | ### Parameters 262 | - ai_sketch_from_image 263 | - path -> path of the svg file 264 | - style_index -> [0-3] each number produces different styles of image 265 | - no_of_processes -> no of individual branches the process the svg file 266 | - scale -> zoom value 267 | - x_offset -> amount of movemnt in x direction 268 | - y_offset -> amount of movemnt in y direction 269 | - save -> (True by defaule)= take a screenshot and save it 270 | - load_svg 271 | - file_name -> name of the npy array, you can use this array data to sketch images directly 272 | - draw 273 | - retain -> retain the window after sketching (true by defaule) 274 | - file -> file path of the npy file for direct sketching 275 | - data -> raw data, should be a list in [[[x1,y1], [x2,y2], ....], [255,255,255]], first nested list is the points and the second list the color 276 | - x_offset -> amount of movement in x direction while sketching 277 | - y_offset -> amount of movement in y direction while sketching 278 | - scale -> zoom value while sketching 279 | - speed -> speed of sketching 280 | 281 | # Library Example 282 | 283 | Open your code editor and write the example Python code snippets given below. Run your code and see the magic by yourself. 284 | 285 | 286 | ### Drawing Robert Downey Jr. Using Python 287 | 288 | ``` 289 | from sketchpy3 import library as lib 290 | obj = lib.rdj() 291 | obj.draw() 292 | ``` 293 | 294 | ### OUTPUT 295 |
296 | 297 |
298 | 299 | 300 | 301 | ### Drawing Tom Holland Using Python 302 | 303 | ``` 304 | from sketchpy3 import library 305 | myObject = library.tom_holland() 306 | myObject.draw() 307 | ``` 308 | 309 | 310 | ### OUTPUT 311 |
312 | 313 |
314 | 315 | ### More examples 316 | 317 | ``` 318 | from sketchpy3 import library as lib 319 | 320 | obj = lib.bts() 321 | obj.draw() 322 | ``` 323 | 324 | ``` 325 | from sketchpy3 import library as lib 326 | 327 | obj = lib.vijay() 328 | obj.draw() 329 | ``` 330 |
331 | 332 | 333 |
334 | 335 | ### Drawing Iron Man ASCII Animation Using Python 336 | 337 | ``` 338 | from sketchpy3 import library 339 | myObject = library.ironman_ascii() 340 | myObject.draw() 341 | ``` 342 | 343 | ### OUTPUT 344 | 345 |
346 | 347 |
348 | 349 | 350 | 351 | ### Troubleshooting 352 | 353 | - If you find any problem, you can pull request, or contact me on either [insta](https://www.instagram.com/mr.m_y_s_t_e_r_y/) or [discord](https://discord.gg/r2KFa73PM2) 354 | - You can also find video on my [youtube channel](https://www.youtube.com/playlist?list=PLb1Kbw_2jl_mr3A_cl6pXA1N5lwtHCx_7) 355 | - You can know more about sketchpy and get tutorial in this blog [page](https://codehub03.blogspot.com/) 356 | 357 | 358 | 359 | 360 | ### Acknowledgements 361 | 362 | Thanks to all who helped inspire this project.❤ 363 | 364 | ### See also 365 | 366 | - [Youtube Videos](https://www.youtube.com/playlist?list=PLb1Kbw_2jl_mr3A_cl6pXA1N5lwtHCx_7) 367 | - [Related Blogs](https://codehub0.blogspot.com/) 368 | - [Contact me on Discord](https://discord.gg/r2KFa73PM2) 369 | - [My insta ID](https://www.instagram.com/mr.m_y_s_t_e_r_y/) 370 | 371 | # Consider supporting me 372 | - we spend `hours` to implement these algorithms and making you to access these with just 3 lines 373 | - consider `supporting` our work. 374 | - even a single `rupee` conunts. 375 | - upi id `sriramanand23@okicici` 376 | - scan and encourage us to develop more features or use the `short url` to get the svg file 377 | 378 | 379 | ![gpay qr code](https://user-images.githubusercontent.com/80098044/177810955-d9e1dae5-e84e-4839-a806-da76f93cb27e.jpg) 380 | 381 | 382 | ### License 383 | 384 | This project is licensed under the [MIT License](https://github.com/MRMYSTERY003/sketchpy/blob/main/LICENSE). 385 | -------------------------------------------------------------------------------- /dist/sketchpy3-0.3.2-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRMYSTERY003/sketchpy/ee1f9661beac8102eda5b7a91c25a3cded14ab33/dist/sketchpy3-0.3.2-py3-none-any.whl -------------------------------------------------------------------------------- /dist/sketchpy3-0.3.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRMYSTERY003/sketchpy/ee1f9661beac8102eda5b7a91c25a3cded14ab33/dist/sketchpy3-0.3.2.tar.gz -------------------------------------------------------------------------------- /images/rdj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRMYSTERY003/sketchpy/ee1f9661beac8102eda5b7a91c25a3cded14ab33/images/rdj.jpg -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages, Extension 2 | import codecs 3 | import os 4 | 5 | 6 | 7 | 8 | VERSION = '0.3.2' 9 | DESCRIPTION = 'sketchpy3' 10 | LONG_DESCRIPTION = """ 11 | # Welcome to sketchpy 12 | 13 | 14 |
15 | 16 |
17 | 18 | ## Description 19 | 20 | This is the Intermediate level python project to do some awesome drawing animation using the `turtle` module, hope it grows in the future. 21 | It is a Python module for animating drawings of images. The sketchpy module is created on top of the turtle module in Python. 22 | To install sketchpy on your computer, you can go to your command prompt (command line) and run the following command. 23 | 24 | ### Usage 25 | 26 | - Just install the package `pip install sketchpy3` 27 | - Followed by `pip install --upgrade sketchpy3` to update the package to the latest version. 28 | - Import it to you project `import sketchpy3` and use as you want😊 29 | 30 | ### Built with 31 | 32 | - Turtle 33 | - Open-cv 34 | - Pillow 35 | - numpy 36 | - Svgpathtools 37 | 38 | ## Getting started 39 | 40 | ### Lastes version of sketchpy: 0.1.8 41 | 42 | - you can install the latest version with either 43 | ``` 44 | pip install sketchpy3==0.3.1 45 | ``` 46 | or 47 | ``` 48 | pip install sketchpy3 --U 49 | ``` 50 | 51 | ## Updates!! 52 | 53 | - Now uses `AI` to generate different styles of images for sketching using the class `canvas.ai_sketch_from_image` 54 | - You can use the function as followes 55 | ``` 56 | from sketchpy3 import canvas 57 | if __name__ == "__main__": 58 | obj = canvas.ai_sketch_from_image(IMG_PATH,3) 59 | obj.draw() 60 | ``` 61 | 62 | - Sample 63 |
64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
72 | 73 | - The first image is the `source image`, and the following corresponds to different styles from `[0-3]` 74 | - This version `0.3.1` uses multiprocessing for processing the single svg file in 4 different threads to reduce the time for loading the svg file 75 | - Sample 76 |
77 | 78 |
79 | - And I have included a new function named `get_svg()` from `canvas` to convert your Image to svg, 80 | - You can use the function as followes 81 | ``` 82 | from sketchpy import canvas 83 | canvas.get_svg(img_path) 84 | ``` 85 | - The `get_svg()` function opens a short url only `once` a day. Just enter the 4 digit number from the landing page from the short url in the cmd to access the svg converter. And you need to complete the short url only once a day, So it's no big deal. 86 | 87 | 88 | 89 | ### Prerequisites 90 | 91 | - Python 92 | - Basic text editor 93 | - creativity😂 94 | 95 | ### Install 96 | 97 | ``` 98 | pip install sketchpy3 99 | ``` 100 | it should probably work, If not then try the following code 101 | 102 | ``` 103 | pip install turtle open-cv wheel sketchpy3 104 | ``` 105 | 106 | 107 | # Trace from Image 108 | 109 | The recent version of the package includes a class named `trace_from_image()`, which allowes you to get the same output as using a svg file without the need to convert it to a svg file. hecnce it reduces the run time and it is much effecient. 110 | 111 | - To know more about this new class visit the blog post [here](https://codehub03.blogspot.com/2023/07/how-to-draw-ai-hoshino-with-just-3.html). 112 | - A sample output of the class `trace_from_image()`. 113 | - you can take a view about how the class working in [here](https://youtube.com/shorts/_F23GwUJcIU?feature=share) 114 | 115 | 116 | 117 |
118 | 119 | 120 |
121 | 122 | 123 | Sample Code: 124 | ``` 125 | from sketchpy3 impor canvas 126 | obj = canvas.trace_from_image("Image Path") 127 | obj.draw() 128 | ``` 129 | ### Parameters : 130 | 131 | - Path: Path of the image 132 | - Scale: 133 | -scaling factor for the sketched image, 134 | - less than 1 => smaller than original image 135 | - equal to 1 => original size 136 | - greater than 1 => greater than original image 137 | 138 | - intensity -> intensity of details, keep the value between 0 and 255, optimal value lies between(200 - 255) 139 | - save -> take a screenshot when the program stops sketching, false by default 140 | - details -> use to skip the small details from the image to increase the speed. details=0 -> inculde all minor details, details=50 -> include all details which are greater than 50 141 | - blur -> always provide a odd number, the lower the value the more distortion, higher the value the more smooth, optimal value 51 142 | - skip_frequency -> used to speed the sketchpy the process by skipping some values 143 | 144 | 145 | # Sketch from Image 146 | used to trace the image line by line. 147 | 148 | Example Code : 149 | 150 | ``` 151 | from sketchpy impor canvas 152 | obj = canvas.sketch_from_image("Image Path") 153 | obj.draw(threshold = 127) 154 | ``` 155 | 156 | ### Parameters 157 | - path -> path of the image 158 | - save -> used to same the results 159 | 160 | you can watch the example video from [here](https://www.youtube.com/watch?v=hCRppNooLYE) 161 | #### NOTE: you can change the value of threshold to draw more detailed image, it's range is 0 - 255,use values between 90-190 162 | to know more about it visit [here](https://codehub03.blogspot.com/2022/04/how-to-draw-image-with-python-using.html) 163 | 164 | 165 | # Drawing From `SVG` file 166 | 167 | 168 | You can sketch image uinsg the class `color_sketch_from_svg`, which takes the inpu in svg formate and then sketches it. 169 | Example Code: 170 | ``` 171 | from sketchpy3 impor canvas 172 | if __name__ == "__main__": 173 | obj = canvas.color_sketch_from_svg("Image Path") 174 | obj.draw() 175 | ``` 176 | 177 | Example output 178 | 179 |
180 | 181 |
182 | 183 | #### NOTE: `sketch_from_svg` class is remove from the package, since it can only draw with single color, `color_sketch_from_svg` class will be available. 184 | ### Parameters 185 | - color_sketch_from_svg 186 | - path -> path of the svg file 187 | - no_of_processes -> no of individual branches the process the svg file 188 | - scale -> zoom value 189 | - x_offset -> amount of movemnt in x direction 190 | - y_offset -> amount of movemnt in y direction 191 | - save -> (True by defaule)= take a screenshot and save it 192 | - load_svg 193 | - file_name -> name of the npy array, you can use this array data to sketch images directly 194 | - draw 195 | - retain -> retain the window after sketching (true by defaule) 196 | - file -> file path of the npy file for direct sketching 197 | - data -> raw data, should be a list in [[[x1,y1], [x2,y2], ....], [255,255,255]], first nested list is the points and the second list the color 198 | - x_offset -> amount of movement in x direction while sketching 199 | - y_offset -> amount of movement in y direction while sketching 200 | - scale -> zoom value while sketching 201 | - speed -> speed of sketching 202 | 203 |
204 | 205 | 206 | # Sketching form `.npy` file 207 | 208 | Insted of waiting for the svg file to load, you can saved `.npy` file and use that for future use, 209 | use the following code to draw your image from saved data file 210 | 211 | ``` 212 | from sketchpy3 import canvas 213 | obj = canvas.color_sketch_from_svg(None) 214 | obj.draw(file = 'data.npy') 215 | ``` 216 | 217 |
218 | 219 | # Converting `Image` to `SVG` formate 220 | 221 | Sketchpy3 requires specific type of `SVG` file formate to work properly, hence this version includes a standalone svg converter function with it 222 | use the follow code to convert you images to svg files 223 | 224 | ``` 225 | from sketchpy3 import canvas 226 | canvas.get_svg(IMG_PATH) 227 | ``` 228 | 229 | - It takes the image from the `IMG_PATH` and converts it into an svg file 230 | - But to access this SVG converter you have to complete a shorturl, don't worry you need to do this only once a day 231 | - Use brave browser to complete it with ih 20 sec. 232 | 233 |
234 | 235 | # Converting `Image` to `AI ART` 236 | 237 | - This new version sketchpy3 includes a class named `ai_sketch_from_image` 238 | - This class converts the given imag to different styles of image using `generative art` from bryandlee/animegan2 239 | - You can use it as follows 240 | 241 | ``` 242 | from sketchpy3 import canvas 243 | 244 | if __name__ == "__main__": 245 | obj = canvas.ai_sketch_from_image(IMG_PATH, STYLE_INDEX) 246 | obj.draw() 247 | ``` 248 | ### Use the following code to get the AI ART as image 249 | 250 | ``` 251 | from sketchpy3 import canvas 252 | obj = canvas.ai_sketch_from_image(IMG_PATH, STYLE_INDEX) 253 | obj.convert_image() 254 | ``` 255 | - You can find your output image as `source.jpg` file 256 | 257 | ### Example 258 | 259 |
260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 |
269 | 270 | 271 | ### Parameters 272 | - ai_sketch_from_image 273 | - path -> path of the svg file 274 | - style_index -> [0-3] each number produces different styles of image 275 | - no_of_processes -> no of individual branches the process the svg file 276 | - scale -> zoom value 277 | - x_offset -> amount of movemnt in x direction 278 | - y_offset -> amount of movemnt in y direction 279 | - save -> (True by defaule)= take a screenshot and save it 280 | - load_svg 281 | - file_name -> name of the npy array, you can use this array data to sketch images directly 282 | - draw 283 | - retain -> retain the window after sketching (true by defaule) 284 | - file -> file path of the npy file for direct sketching 285 | - data -> raw data, should be a list in [[[x1,y1], [x2,y2], ....], [255,255,255]], first nested list is the points and the second list the color 286 | - x_offset -> amount of movement in x direction while sketching 287 | - y_offset -> amount of movement in y direction while sketching 288 | - scale -> zoom value while sketching 289 | - speed -> speed of sketching 290 | 291 | # Library Example 292 | 293 | Open your code editor and write the example Python code snippets given below. Run your code and see the magic by yourself. 294 | 295 | 296 | ### Drawing Robert Downey Jr. Using Python 297 | 298 | ``` 299 | from sketchpy3 import library as lib 300 | obj = lib.rdj() 301 | obj.draw() 302 | ``` 303 | 304 | ### OUTPUT 305 |
306 | 307 |
308 | 309 | 310 | 311 | ### Drawing Tom Holland Using Python 312 | 313 | ``` 314 | from sketchpy3 import library 315 | myObject = library.tom_holland() 316 | myObject.draw() 317 | ``` 318 | 319 | 320 | ### OUTPUT 321 |
322 | 323 |
324 | 325 | ### More examples 326 | 327 | ``` 328 | from sketchpy3 import library as lib 329 | 330 | obj = lib.bts() 331 | obj.draw() 332 | ``` 333 | 334 | ``` 335 | from sketchpy3 import library as lib 336 | 337 | obj = lib.vijay() 338 | obj.draw() 339 | ``` 340 |
341 | 342 | 343 |
344 | 345 | ### Drawing Iron Man ASCII Animation Using Python 346 | 347 | ``` 348 | from sketchpy3 import library 349 | myObject = library.ironman_ascii() 350 | myObject.draw() 351 | ``` 352 | 353 | ### OUTPUT 354 | 355 |
356 | 357 |
358 | 359 | 360 | 361 | ### Troubleshooting 362 | 363 | - If you find any problem, you can pull request, or contact me on either [insta](https://www.instagram.com/mr.m_y_s_t_e_r_y/) or [discord](https://discord.gg/r2KFa73PM2) 364 | - You can also find video on my [youtube channel](https://www.youtube.com/playlist?list=PLb1Kbw_2jl_mr3A_cl6pXA1N5lwtHCx_7) 365 | - You can know more about sketchpy and get tutorial in this blog [page](https://codehub03.blogspot.com/) 366 | 367 | 368 | 369 | 370 | ### Acknowledgements 371 | 372 | Thanks to all who helped inspire this project.❤ 373 | 374 | ### See also 375 | 376 | - [Youtube Videos](https://www.youtube.com/playlist?list=PLb1Kbw_2jl_mr3A_cl6pXA1N5lwtHCx_7) 377 | - [Related Blogs](https://codehub0.blogspot.com/) 378 | - [Contact me on Discord](https://discord.gg/r2KFa73PM2) 379 | - [My insta ID](https://www.instagram.com/mr.m_y_s_t_e_r_y/) 380 | 381 | # Consider supporting me 382 | - we spend `hours` to implement these algorithms and making you to access these with just 3 lines 383 | - consider `supporting` our work. 384 | - even a single `rupee` conunts. 385 | - upi id `sriramanand23@okicici` 386 | - scan and encourage us to develop more features or use the `short url` to get the svg file 387 | 388 | 389 | ![gpay qr code](https://user-images.githubusercontent.com/80098044/177810955-d9e1dae5-e84e-4839-a806-da76f93cb27e.jpg) 390 | 391 | 392 | ### License 393 | 394 | This project is licensed under the [MIT License](https://github.com/MRMYSTERY003/sketchpy/blob/main/LICENSE). 395 | 396 | """ 397 | # Setting up 398 | setup( 399 | name="sketchpy3", 400 | version=VERSION, 401 | author="Mr Mystery", 402 | author_email="sriramanand23@gmail.com", 403 | description=DESCRIPTION, 404 | long_description_content_type="text/markdown", 405 | long_description=LONG_DESCRIPTION, 406 | 407 | packages=find_packages(), 408 | package_data={'': ['files/*']}, 409 | include_package_data=True, 410 | install_requires=['opencv-python', 'turtle==0.0.1', 411 | 'wheel', 'Pillow', 'svg.path', 'svgpathtools', 'tqdm', 'requests', 'geocoder', 'geopy','torch'], 412 | keywords=['python', 'sketch', 'drawing', 'animation', 413 | 'code hub', 'pencil sketch', 'painting', 'sketchpy', 'draw', 'sketching'], 414 | classifiers=[ 415 | "Development Status :: 1 - Planning", 416 | "Intended Audience :: Developers", 417 | "Programming Language :: Python :: 3", 418 | "Operating System :: Microsoft :: Windows", 419 | ] 420 | ) -------------------------------------------------------------------------------- /sketchpy3/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRMYSTERY003/sketchpy/ee1f9661beac8102eda5b7a91c25a3cded14ab33/sketchpy3/__init__.py -------------------------------------------------------------------------------- /sketchpy3/canvas.py: -------------------------------------------------------------------------------- 1 | import multiprocessing as mp 2 | from tqdm import tqdm 3 | import numpy as np 4 | import turtle as tu 5 | import os 6 | import cv2 7 | import sys 8 | import subprocess 9 | from svgpathtools import svg2paths2 10 | from svg.path import parse_path 11 | from PIL import ImageGrab 12 | import pkg_resources 13 | import torch 14 | from PIL import Image 15 | import warnings 16 | warnings.filterwarnings("ignore", message="TypedStorage is deprecated") 17 | import winsound 18 | 19 | 20 | 21 | def get_svg(image_path, output_path=None): 22 | '''Usage: \n 23 | from sketchpy import canvas 24 | canvas.get_svg() 25 | 26 | opens a local window from converting image files to svg files\n 27 | requires internet connection!!!''' 28 | 29 | 30 | 31 | exe_path = pkg_resources.resource_filename('sketchpy3', 'files/trace.exe') 32 | try: 33 | if output_path != None: 34 | subprocess.run([exe_path, image_path, output_path], shell=True) 35 | else: 36 | subprocess.run([exe_path, image_path], shell=True) 37 | 38 | except Exception as e: 39 | print("An error occurred:", e) 40 | 41 | 42 | class trace: 43 | def __init__(self, img_path, zoom=5, scale=0.25): 44 | """trace any image you want, with the help of this trace class\n 45 | USE RIGHT CLICK TO CREATE A TRACE POINT \n 46 | USE LEFT CLICK TO REMOVE A TRACE POINT\n 47 | ONCE FINISHED PRESS ANY BUTTON TO SAVE YOUR DATA\n \n 48 | img_path - path of the image to be traced\n 49 | zoom - zoom of the image\n 50 | scale - scale of the original image""" 51 | self.coordinates = [] 52 | self.scale_x, self.scale_y = scale, scale 53 | self.zoom_scale_x, self.zoom_scale_y = zoom, zoom 54 | self.cx, self.cy = (self.zoom_scale_x * 100) // 2, ( 55 | self.zoom_scale_y * 100 56 | ) // 2 57 | print( 58 | "----- USE RIGHT CLICK TO CREATE A TRACE POINT -----\n----- USE LEFT CLICK TO REMOVE A TRACE POINT -----\n----- ONCE FINISHED PRESS ANY BUTTON TO SAVE YOUR DATA -----" 59 | ) 60 | 61 | img = cv2.imread(img_path) 62 | self.img = cv2.resize(img, (0, 0), None, self.scale_x, self.scale_y) 63 | self.color_li = [] 64 | 65 | def click_event(self, event, x, y, flag, params): 66 | if event == cv2.EVENT_LBUTTONDOWN: 67 | print(x, " ", y) 68 | self.coordinates.append((x, y)) 69 | print(self.img[x][y]) 70 | self.color_li.append(tuple(self.img[x][y])) 71 | temp = cv2.circle( 72 | self.img, (x, y), radius=1, color=(0, 255, 255), thickness=-1 73 | ) 74 | if event == cv2.EVENT_RBUTTONDOWN: 75 | print(f"poping {x} and {y}") 76 | print( 77 | f"coord : {self.coordinates[-1]}\n color : {tuple(self.color_li[-1])}" 78 | ) 79 | temp = cv2.circle( 80 | self.img, 81 | tuple(self.coordinates[-1]), 82 | radius=0, 83 | color=( 84 | int(self.color_li[-1][0]), 85 | int(self.color_li[-1][1]), 86 | int(self.color_li[-1][2]), 87 | ), 88 | thickness=-1, 89 | ) 90 | print( 91 | f"actual col {self.img[x][y]} : changed img {int(self.color_li[-1][0]),int(self.color_li[-1][1]),int(self.color_li[-1][2])}" 92 | ) 93 | # print('img:',img[y,x,:]) 94 | 95 | self.coordinates.pop() 96 | self.color_li.pop() 97 | if event == cv2.EVENT_MBUTTONDOWN: 98 | print("mouse wheel pressed") 99 | print("creating break point") 100 | self.coordinates.append((-1, -1)) 101 | try: 102 | zoom = cv2.resize( 103 | self.img[y - 50 : y + 50, x - 50 : x + 50, :], 104 | (0, 0), 105 | None, 106 | self.zoom_scale_x, 107 | self.zoom_scale_y, 108 | ) 109 | zoom[self.cx - 3 : self.cx + 3, self.cx - 3 : self.cx + 3, :] = 175 110 | cv2.imshow("zoom", zoom) 111 | except: 112 | print("out of range!!") 113 | 114 | def trace(self): 115 | cv2.imshow("Main image", self.img) 116 | cv2.setMouseCallback("Main image", self.click_event) 117 | cv2.waitKey(0) 118 | cv2.destroyAllWindows() 119 | print(self.coordinates) 120 | 121 | if len(self.coordinates) > 0: 122 | from os.path import exists 123 | 124 | file = input("enter the name the file: ") 125 | 126 | path_exists = exists(f"./{file}.txt") 127 | 128 | if path_exists: 129 | print(f"the file {file} already exists!!!") 130 | des = input("do you what to append the data: (y/n) ") 131 | if des == "y" or des == "Y": 132 | data = open(f"{file}.txt", "a") 133 | print("creating a break point and appending....") 134 | data.write(str((-1, -1)) + "\n") 135 | for i in self.coordinates: 136 | # x,y = i 137 | data.write(str(i) + "\n") 138 | print(f"all the coordinates are save in {file}") 139 | data.close() 140 | else: 141 | print("deleting all the data and writing.....") 142 | data = open(f"{file}.txt", "w") 143 | for i in self.coordinates: 144 | x, y = i 145 | data.write(str(i) + "\n") 146 | print(f"all the coordinates are save in {file}") 147 | data.close() 148 | 149 | else: 150 | data = open(f"{file}.txt", "w") 151 | for i in self.coordinates: 152 | x, y = i 153 | data.write(str(i) + "\n") 154 | print(f"all the coordinates are save in {file}") 155 | data.close() 156 | 157 | else: 158 | print("no coordinates are detected to be saved...") 159 | 160 | 161 | 162 | class sketch: 163 | 164 | def __init__(self, x_offset=300, y_offset=300, save=False): 165 | """Draw the traced image with help of this sketch function\n 166 | x-offset - postion of the image in x axis\n 167 | y-offset - postion of the image in y axis\n 168 | call the draw_fn() to draw the traced image""" 169 | self.pen = tu.Turtle() 170 | self.pen.speed(0) 171 | self.x_offset = x_offset 172 | self.y_offset = y_offset 173 | self.save = save 174 | 175 | def get_coord(self, data): 176 | tu = [] 177 | for i in data.readlines(): 178 | i = (i.strip("\n")).strip("(").strip(")") 179 | tu.append(tuple(map(int, i.split(",")))) 180 | 181 | return tu 182 | 183 | def go(self, x, y): 184 | self.pen.penup() 185 | self.pen.goto(x - self.x_offset, (y * -1) + self.y_offset) 186 | self.pen.pendown() 187 | 188 | def paint(self, coord, co=(0, 0, 0)): 189 | self.pen.color(co) 190 | t_x, t_y = coord[0] 191 | self.go(t_x, t_y) 192 | self.pen.fillcolor(co) 193 | self.pen.begin_fill() 194 | t = 0 195 | for i in coord[1:]: 196 | print(i) 197 | x, y = i 198 | if t: 199 | self.go(x, y) 200 | t = 0 201 | self.pen.begin_fill() 202 | continue 203 | if x == -1 and y == -1: 204 | t = 1 205 | self.pen.end_fill() 206 | continue 207 | else: 208 | self.pen.goto(x - self.x_offset, (y * -1) + self.y_offset) 209 | self.pen.end_fill() 210 | 211 | def draw_fn(self, file, mode=1, co=(0, 0, 0), thickness=1, retain=False): 212 | """file - path of the file which contains the coordinates\n 213 | mode - mode of drawing (1 - sketch with line, 0 - fill with color)\n 214 | co - color of the line or fill\n 215 | thickness - thickness of the line\n 216 | retain - retain the image drawn after executing""" 217 | 218 | co = (co[0] / 255, co[1] / 255, co[2] / 255) 219 | 220 | self.pen.color(co) 221 | data = open(f"{file}.txt", "r") 222 | coord = self.get_coord(data) 223 | 224 | self.pen.width(thickness) 225 | if mode: 226 | t_x, t_y = coord[0] 227 | self.go(t_x, t_y) 228 | t = 0 229 | for i in coord[1:]: 230 | print(i) 231 | x, y = i 232 | if t: 233 | self.go(x, y) 234 | t = 0 235 | continue 236 | if x == -1 and y == -1: 237 | t = 1 238 | continue 239 | else: 240 | self.pen.goto(x - self.x_offset, (y * -1) + self.y_offset) 241 | else: 242 | self.paint(coord=coord, co=co) 243 | 244 | if self.save: 245 | image = ImageGrab.grab() 246 | image.save("sketch.png") 247 | print("your sketch is saved as sketch.png!!") 248 | 249 | 250 | if retain: 251 | tu.done() 252 | 253 | 254 | 255 | class ascii_art: 256 | def __init__( 257 | self, 258 | x_len=5, 259 | y_len=7, 260 | chars=["*", "S", "#", "&", "@", "$", "%", "*", "!", ":", "."], 261 | color_set={ 262 | "*": "white", 263 | "S": "green", 264 | "#": "green", 265 | "&": "white", 266 | "@": "black", 267 | "$": "white", 268 | "%": "white", 269 | "!": "blue", 270 | ":": "darkgreen", 271 | ".": "grey", 272 | }, 273 | save=True, 274 | ): 275 | """example usage: 276 | from sketchpy import canvas 277 | obj = cavnas.ascii_art() 278 | res = obj.load_data(img_path="image.png") 279 | obj.draw() 280 | 281 | paramerter: 282 | x_len = pixel movement in x direction 283 | y_lenn = pixel movement in y direction 284 | chars = list of characters to be used from convertion of image to ASCII art 285 | color_set = dictionary map for specific character to a specific color 286 | save = takes a screen shot of the entire screen and saves it 287 | 288 | """ 289 | self.x_len = x_len 290 | self.y_len = y_len 291 | self.chars = chars 292 | self.colo_set = color_set 293 | self.save = save 294 | 295 | def convert_to_acsii(self, img_path, file_name=None) -> str: 296 | """Converts the given image to ascii art and save it to output_file, returns string 297 | img_path = path of the image 298 | file_name = name of the output text file""" 299 | 300 | from PIL import Image 301 | 302 | # pass the image as command line argument 303 | img = Image.open(img_path) 304 | 305 | # resize the image 306 | width, height = img.size 307 | aspect_ratio = height / width 308 | new_width = 80 309 | new_height = aspect_ratio * new_width * 0.55 310 | img = img.resize((new_width, int(new_height))) 311 | # new size of image 312 | # print(img.size) 313 | 314 | # convert image to greyscale format 315 | img = img.convert("L") 316 | 317 | pixels = img.getdata() 318 | 319 | # replace each pixel with a character from array 320 | chars = self.chars 321 | new_pixels = [chars[pixel // 25] for pixel in pixels] 322 | new_pixels = "".join(new_pixels) 323 | 324 | # split string of chars into multiple strings of length equal to the new width and create a list 325 | new_pixels_count = len(new_pixels) 326 | ascii_image = [ 327 | new_pixels[index : index + new_width] 328 | for index in range(0, new_pixels_count, new_width) 329 | ] 330 | n_chars = len(ascii_image[0]) 331 | 332 | self.half_width = n_chars * self.x_len * -1 333 | 334 | ascii_image = "\n".join(ascii_image) 335 | 336 | # write to a text file. 337 | if file_name != None: 338 | with open(f"{file_name}.txt", "w") as f: 339 | f.write(ascii_image) 340 | print(ascii_image) 341 | return ascii_image 342 | 343 | def load_data(self, file_path=None, img_path=None, raw_data=None): 344 | """used to load a previously processed image, 345 | file_path = path of the ascii art txt file 346 | img_path = path of the image 347 | raw_data = sting containing the ascii art""" 348 | 349 | if img_path != None: 350 | self.data = self.convert_to_acsii(img_path) 351 | elif file_path != None: 352 | re = open(file_path, "r") 353 | self.data = re.readlines() 354 | elif raw_data != None: 355 | self.data = raw_data 356 | print("sepcify the correct data") 357 | return 358 | return self.data 359 | 360 | def draw(self, data=None): 361 | # setting the x and y coordinates 362 | s_x = self.half_width 363 | s_y = 250 364 | 365 | if data != None: 366 | self.data = data 367 | 368 | p = tu.Pen() 369 | p.speed(0) 370 | tu.bgcolor("black") 371 | p.up() 372 | p.width(2) 373 | p.goto(s_x, s_y) 374 | p.down() 375 | 376 | # function to select the color 377 | def set_col(c): 378 | chars = self.colo_set 379 | col = chars[c] 380 | p.pencolor(col) 381 | return col 382 | 383 | for i in self.data: 384 | 385 | if i == "\n": 386 | p.up() 387 | p.goto(self.half_width, s_y - self.y_len) 388 | s_y -= self.y_len 389 | s_x = self.half_width 390 | p.down() 391 | continue 392 | else: 393 | col = set_col(i) 394 | if col == "black": 395 | s_x += 2 * self.x_len 396 | p.up() 397 | p.goto(s_x, s_y) 398 | continue 399 | else: 400 | p.down() 401 | s_x += self.x_len 402 | p.goto(s_x, s_y) 403 | 404 | s_x += self.x_len 405 | p.up() 406 | p.goto(s_x, s_y) 407 | p.down() 408 | if self.save: 409 | image = ImageGrab.grab() 410 | image.save("sketch.png") 411 | print("your sketch is saved as sketch.png!!") 412 | winsound.PlaySound("SystemDefault", winsound.SND_ALIAS) 413 | tu.done() 414 | 415 | def print_to_terminal(self): 416 | for i in self.data: 417 | print(i, end="") 418 | 419 | 420 | 421 | class color_sketch_from_svg: 422 | 423 | def __init__( 424 | self, 425 | path=None, 426 | no_of_processes = 4, 427 | scale=500, 428 | x_offset=0, 429 | y_offset=0, 430 | save=True, 431 | ): 432 | """ 433 | path -> path of the svg file\n 434 | no_of_processes -> on of simultanious threads to process the SVG file faster(set it to the no of cores in the system, default value: 4)\n 435 | scale -> zoom value\n 436 | x_offset -> amount of movemnt in x direction\n 437 | y_offset -> amount of movemnt in y direction\n 438 | save -> True = take a screenshot and save it\n 439 | 440 | used to sketch an colored image from a svg file, reffer my youtube channel to know more about it 441 | """ 442 | self.path = path 443 | self.x_offset = x_offset 444 | self.y_offset = y_offset 445 | self.scale = scale 446 | self.save = save 447 | self.no_of_processes = no_of_processes 448 | 449 | 450 | def hex_to_rgb(self, string): 451 | strlen = len(string) 452 | # print(string) 453 | if string.startswith("#"): 454 | if strlen == 7: 455 | r = string[1:3] 456 | g = string[3:5] 457 | b = string[5:7] 458 | elif strlen == 4: 459 | r = string[1:2] * 2 460 | g = string[2:3] * 2 461 | b = string[3:4] * 2 462 | elif strlen == 3: 463 | r = string[0:1] * 2 464 | g = string[1:2] * 2 465 | b = string[2:3] * 2 466 | else: 467 | r = string[0:2] 468 | g = string[2:4] 469 | b = string[4:6] 470 | 471 | return int(r, 16) / 255, int(g, 16) / 255, int(b, 16) / 255 472 | 473 | def process(self,data, id, queue): 474 | try: 475 | for i in tqdm(data): 476 | path = parse_path(i["d"]) 477 | # co = i["style"].replace("fill: ", "").replace(";", "") 478 | co = i["fill"] 479 | 480 | col = self.hex_to_rgb(co) 481 | transform = i["transform"].replace("translate(", "").replace(")", "") 482 | transform = list(map(float, transform.split(","))) 483 | transform = list(map(int, transform)) 484 | n = str(path).split(" ") 485 | n = len(n) // 5 - 10 486 | if n <= 20: 487 | n = 20 488 | pts = [ 489 | ( 490 | (int(((p.real + transform[0]) / self.width) * self.scale)) 491 | - self.x_offset, 492 | (int(((p.imag + transform[1]) / self.height) * self.scale)) 493 | - self.y_offset, 494 | ) 495 | for p in (path.point(i / n) for i in range(1, n + 1)) 496 | ] 497 | 498 | queue.put((pts, col)) 499 | except Exception as e: 500 | print(f"Error : {e}") 501 | 502 | def load_svg(self, file_name=os.path.abspath(sys.argv[0])): 503 | """file_name -> name of the npy array, you can use this array data to sketch images directly""" 504 | if self.path != None: 505 | paths, attributes, svg_att = svg2paths2(self.path) 506 | self.attr = attributes 507 | print("loding svg data...") 508 | try: 509 | try: 510 | h = svg_att["height"] 511 | w = svg_att["width"] 512 | except: 513 | temp = list(map(int, svg_att["viewBox"].split())) 514 | h = temp[2] 515 | w = temp[3] 516 | 517 | try: 518 | h = h.replace("px", "") 519 | w = w.replace("px", "") 520 | if h.find(".") != -1: 521 | self.height = int(h[: h.find(".")]) 522 | self.width = int(w[: w.find(".")]) 523 | self.height = int(h) 524 | self.width = int(w) 525 | except: 526 | self.height = int(h) 527 | self.width = int(w) 528 | 529 | if self.x_offset == 0: 530 | self.x_offset = (self.height) // 2 531 | 532 | if self.y_offset == 0: 533 | self.y_offset = (self.width) // 2 534 | 535 | self.res = [] 536 | try: 537 | self.res.append([self.height, self.width, self.scale]) 538 | def divide_list(lst, n): 539 | division = len(lst) / n 540 | return [lst[int(round(division * i)): int(round(division * (i + 1)))] for i in range(n)] 541 | 542 | 543 | div_list = divide_list(attributes, self.no_of_processes) 544 | processes = [] 545 | queue = mp.Queue() 546 | for num, i in enumerate(div_list): 547 | p = mp.Process(target= self.process, args= ( i, num, queue )) 548 | p.start() 549 | 550 | processes.append(p) 551 | 552 | while True: 553 | if not any(p.is_alive() for p in processes) and queue.empty(): 554 | break # If all processes finished and queue is empty, break the loop 555 | while not queue.empty(): 556 | data_received = queue.get() 557 | self.res.append(data_received) 558 | 559 | 560 | for p in processes: 561 | p.join() 562 | 563 | # temp = [self.res] 564 | 565 | # for num in range(self.no_of_processes): 566 | # temp.append(np.load(f"{num}.npy", allow_pickle=True)) 567 | # self.res = np.concatenate(temp, axis=0) 568 | np_array = np.array(self.res) 569 | np.save(file_name+".npy", np_array, allow_pickle=True) 570 | return self.res 571 | 572 | except Exception as e: 573 | print(e) 574 | print(f"Error : {e}") 575 | print("youtube : https://www.youtube.com/c/CODEHUB03") 576 | return None 577 | except Exception as e: 578 | print("error found!!!") 579 | print(f"ERROR: {e}") 580 | print( 581 | """you can contact me on my youtube channel: https://www.youtube.com/c/codehub03 \\n discord : https://discord.gg/r2KFa73PM2 \\n instagram : https://www.instagram.com/mr.m_y_s_t_e_r_y/""" 582 | ) 583 | 584 | def move_to(self, x, y): 585 | self.pen.up() 586 | self.pen.goto(x, y) 587 | self.pen.down() 588 | 589 | def draw( 590 | self, 591 | retain=True, 592 | file=None, 593 | data=None, 594 | x_offset=0, 595 | y_offset=0, 596 | scale=None, 597 | speed=1, 598 | ): 599 | """ 600 | retain -> retain the window after sketching\n 601 | file -> file path of the npy file for direct sketching\n 602 | data -> raw data, should be a list in [[[x1,y1], [x2,y2], ....], [255,255,255]], first nested list is the points and the second list the color\n 603 | x_offset -> amount of movement in x direction while sketching\n 604 | y_offset -> amount of movement in y direction while sketching\n 605 | scale -> zoom value while sketching\n 606 | speed -> speed of sketching""" 607 | if file != None: 608 | coordinates = np.load(file, allow_pickle=True) 609 | print(f"datas are loaded from {file}") 610 | elif data != None: 611 | coordinates = data 612 | else: 613 | coordinates = self.load_svg() 614 | if coordinates == None: 615 | return 0 616 | wn = tu.Screen() 617 | wn.tracer(0) 618 | self.pen = tu.Turtle() 619 | self.pen.speed(0) 620 | self.screen = tu.Screen() 621 | dimension = coordinates[0] 622 | height = dimension[0] 623 | width = dimension[1] 624 | 625 | if scale == None: 626 | try: 627 | scale = dimension[2] 628 | 629 | except: 630 | scale = self.scale 631 | 632 | else: 633 | print(f"scaling the image by the factor of :{scale}") 634 | 635 | print("sketching...") 636 | 637 | for n_path, path_col in enumerate(tqdm(coordinates[1:])): 638 | f = 1 639 | self.pen.color("black") 640 | path = path_col[0] 641 | col = path_col[1] 642 | self.pen.color(col) 643 | self.pen.begin_fill() 644 | 645 | for num, coord in enumerate(path): 646 | x, y = coord 647 | x, y = (int((x * scale) / height)) - x_offset, ( 648 | int((y * scale) / width) 649 | ) - y_offset 650 | y *= -1 651 | if f: 652 | self.pen.end_fill() 653 | self.move_to(x, y) 654 | self.pen.begin_fill() 655 | 656 | f = 0 657 | 658 | elif coord in path[num + 1 :]: 659 | self.pen.end_fill() 660 | self.move_to(x, y) 661 | self.pen.begin_fill() 662 | 663 | else: 664 | self.pen.goto(x, y) 665 | self.pen.end_fill() 666 | if n_path % speed == 0: 667 | wn.update() 668 | 669 | if self.save: 670 | image = ImageGrab.grab() 671 | image.save("sketch.png") 672 | print("your sketch is saved as sketch.png!!") 673 | 674 | if retain == True: 675 | print("done sketching") 676 | winsound.PlaySound("SystemDefault", winsound.SND_ALIAS) 677 | tu.done() 678 | 679 | 680 | 681 | class trace_from_image: 682 | def __init__(self, path, scale=0.75, intensity=170, save=False, details=50, blur=51, skip_frequency=10): 683 | """path -> path of the image to be sketched 684 | 685 | scale - > scaling factor for the sketched image, 686 | 687 | less than 1 => smaller than original image, 688 | equal to 1 => original size 689 | 690 | greater than 1 => greater than original image, 691 | 692 | intensity -> intensity of details, keep the value between 0 and 255, optimal value lies between(200 - 255) 693 | 694 | save -> take a screenshot when the program stops sketching, false by default 695 | 696 | details -> use to skip the small details from the image to increase the speed. details=0 -> inculde all minor details, details=50 -> include all details which are greater than 50 697 | 698 | blur -> always provide a odd number, the lower the value the more distortion, higher the value the more smooth, optimal value 51 699 | 700 | skip_frequency -> used to speed the sketchpy the process by skipping some values 701 | """ 702 | self.path = path 703 | self.scale = scale 704 | self.pen = tu.Turtle() 705 | self.img = cv2.imread(path, 0) 706 | self.x_off = int(-1 * (self.img.shape[1] // 2) * self.scale) 707 | self.y_off = int((self.img.shape[0] // 2) * self.scale) 708 | self.intensity = intensity 709 | self.save = save 710 | self.window = tu.Screen() 711 | self.details = details 712 | self.blur = blur 713 | self.skip = skip_frequency 714 | 715 | def move_to(self, x, y): 716 | self.pen.up() 717 | self.pen.goto(x, y) 718 | self.pen.down() 719 | 720 | def processimage(self): 721 | print("Processing the image ...") 722 | try: 723 | _, binary_image = cv2.threshold( 724 | self.img, self.intensity, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU 725 | ) 726 | kernel = np.ones((1, 1), np.uint8) 727 | binary_image = cv2.morphologyEx( 728 | binary_image, cv2.MORPH_OPEN, kernel, iterations=3 729 | ) 730 | binary_image = cv2.morphologyEx( 731 | binary_image, cv2.MORPH_CLOSE, kernel, iterations=3 732 | ) 733 | num_labels, labels, stats, _ = cv2.connectedComponentsWithStats( 734 | binary_image 735 | ) 736 | output_image = np.zeros( 737 | (self.img.shape[0], self.img.shape[1], 3), dtype=np.uint8 738 | ) 739 | min_region_size = self.details 740 | 741 | for label in range(1, num_labels): 742 | region_size = stats[label, cv2.CC_STAT_AREA] 743 | if region_size > min_region_size: 744 | region = np.where(labels == label, 255, 0).astype(np.uint8) 745 | output_image[np.where(labels == label)] = (255, 255, 255) 746 | 747 | invert = cv2.bitwise_not(output_image) 748 | blur = cv2.GaussianBlur(invert, (self.blur, self.blur), 0) 749 | invertedblur = cv2.bitwise_not(blur) 750 | sketch = cv2.divide(output_image, invertedblur, scale=256.0) 751 | 752 | cv2.imwrite("ttmp.jpg", sketch) 753 | self.img = cv2.imread("ttmp.jpg") 754 | 755 | grey_img = cv2.cvtColor(self.img, cv2.COLOR_BGR2GRAY) 756 | invert = cv2.bitwise_not(grey_img) 757 | blur = cv2.GaussianBlur(invert, (self.blur, self.blur), 0) 758 | invertedblur = cv2.bitwise_not(blur) 759 | sketch = cv2.divide(grey_img, invertedblur, scale=256.0) 760 | ret, thresh = cv2.threshold(sketch, self.intensity, 255, 0) 761 | ctu, hire = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE) 762 | 763 | return ctu 764 | except Exception as e: 765 | print("error found!!!") 766 | print(f"ERROR: {e}") 767 | print( 768 | """you can contact me on my youtube channel: https://www.youtube.com/c/codehub03 \\n discord : https://discord.gg/r2KFa73PM2 \\n instagram : https://www.instagram.com/mr.m_y_s_t_e_r_y/""" 769 | ) 770 | 771 | def draw(self): 772 | ctu = self.processimage() 773 | for n, pos in enumerate(ctu): 774 | mask = np.zeros(self.img.shape[:2], dtype=np.uint8) 775 | cv2.drawContours(mask, ctu, n, (255), thickness=cv2.FILLED) 776 | average_color = cv2.mean(self.img, mask=mask) 777 | rgb = ( 778 | 1 - average_color[0] / 255, 779 | 1 - average_color[1] / 255, 780 | 1 - average_color[2] / 255, 781 | ) 782 | te = pos.flatten() 783 | if len(te) < self.details: 784 | continue 785 | x, y = ( 786 | int((te[0] * self.scale)) + self.x_off, 787 | int(((te[1] * -1) * self.scale)) + self.y_off, 788 | ) 789 | self.move_to(x, y) 790 | self.pen.color(rgb) 791 | self.pen.speed(0) 792 | temp = (-999, -999) 793 | self.pen.begin_fill() 794 | for i in pos[1::self.skip]: 795 | te = i.flatten() 796 | x, y = ( 797 | int((te[0] * self.scale)) + self.x_off, 798 | int(((te[1] * -1) * self.scale)) + self.y_off, 799 | ) 800 | if temp != (x, y): 801 | self.pen.goto(x, y) 802 | temp = x, y 803 | self.pen.end_fill() 804 | 805 | print("done") 806 | winsound.PlaySound("SystemDefault", winsound.SND_ALIAS) 807 | if self.save: 808 | image = ImageGrab.grab() 809 | image.save("sketch.png") 810 | print("your sketch is saved as sketch.png!!") 811 | tu.done() 812 | 813 | 814 | 815 | 816 | class sketch_from_image: 817 | def __init__(self, path, save=True) -> None: 818 | """used to trace the image line by line, 819 | path -> path of the image 820 | save -> used to same the results 821 | reffer my youtube channel to know more about it,""" 822 | self.path = path 823 | self.save = save 824 | self.window = tu.Screen() 825 | 826 | def draw(self, threshold=127): 827 | 828 | img = cv2.imread(self.path, 2) 829 | ret, bw_img = cv2.threshold(img, threshold, 255, cv2.THRESH_BINARY) 830 | width = int(img.shape[1]) 831 | height = int(img.shape[0]) 832 | print(f"image loaded from {self.path}") 833 | my_screen = tu.Screen() 834 | my_screen.screensize(width, height) 835 | my_pen = tu.Turtle() 836 | my_screen.tracer(0) 837 | 838 | for i in tqdm(range(int(height / 2), int(height / -2), -1)): 839 | my_pen.penup() 840 | my_pen.goto(-(width / 2), i) 841 | 842 | for l in range(-int(width / 2), int(width / 2), 1): 843 | pix_width = int(l + (width / 2)) 844 | pix_height = int(height / 2 - i) 845 | # print(f'height = {pix_height} ,width = {pix_width}, val = {bw_img[pix_height,pix_height]}') 846 | if bw_img[pix_height, pix_width] == 0: 847 | my_pen.pendown() 848 | my_pen.forward(1) 849 | else: 850 | my_pen.penup() 851 | my_pen.forward(1) 852 | my_screen.update() 853 | if self.save: 854 | image = ImageGrab.grab() 855 | image.save("sketch.png") 856 | print("your sketch is saved as sketch.png!!") 857 | 858 | my_pen.hideturtle() 859 | winsound.PlaySound("SystemDefault", winsound.SND_ALIAS) 860 | print("done!") 861 | tu.done() 862 | 863 | 864 | 865 | 866 | class ai_sketch_from_image: 867 | def __init__(self, img_path, 868 | style_index=3, 869 | no_of_processes = 1, 870 | scale=500, 871 | x_offset=0, 872 | y_offset=0, 873 | save=True): 874 | """img_path -> path of the svg file\n 875 | style_index -> [0-3] each index produces different syles of images\n 876 | no_of_processes -> on of simultanious threads to process the SVG file faster(set it to the no of cores in the system, default value: 4)\n 877 | scale -> zoom value\n 878 | x_offset -> amount of movemnt in x direction\n 879 | y_offset -> amount of movemnt in y direction\n 880 | save -> True = take a screenshot and save it\n 881 | 882 | used to sketch an colored cartoon image from a image file, reffer my youtube channel to know more about it 883 | """ 884 | self.path = img_path 885 | self.style_index = style_index 886 | self.x_offset = x_offset 887 | self.y_offset = y_offset 888 | self.scale = scale 889 | self.save = save 890 | self.no_of_processes = no_of_processes 891 | 892 | self.height = 0 893 | self.width = 0 894 | 895 | def convert_image(self): 896 | varients = ['face_paint_512_v1', 'face_paint_512_v2', 'celeba_distill', 'paprika'] 897 | model = torch.hub.load("bryandlee/animegan2-pytorch:main", "generator", pretrained=varients[self.style_index]) 898 | face2paint = torch.hub.load("bryandlee/animegan2-pytorch:main", "face2paint", size=512) 899 | img = Image.open(self.path).convert("RGB") 900 | out = face2paint(model, img) 901 | out.save("source.jpg") 902 | 903 | def hex_to_rgb(self, string): 904 | strlen = len(string) 905 | # print(string) 906 | if string.startswith("#"): 907 | if strlen == 7: 908 | r = string[1:3] 909 | g = string[3:5] 910 | b = string[5:7] 911 | elif strlen == 4: 912 | r = string[1:2] * 2 913 | g = string[2:3] * 2 914 | b = string[3:4] * 2 915 | elif strlen == 3: 916 | r = string[0:1] * 2 917 | g = string[1:2] * 2 918 | b = string[2:3] * 2 919 | else: 920 | r = string[0:2] 921 | g = string[2:4] 922 | b = string[4:6] 923 | 924 | return int(r, 16) / 255, int(g, 16) / 255, int(b, 16) / 255 925 | 926 | def process(self,data, id, queue): 927 | try: 928 | for i in tqdm(data): 929 | path = parse_path(i["d"]) 930 | co = i["fill"] 931 | # co = i["style"].replace("fill: ", "").replace(";", "") 932 | col = self.hex_to_rgb(co) 933 | transform = i["transform"].replace("translate(", "").replace(")", "") 934 | transform = list(map(float, transform.split(","))) 935 | transform = list(map(int, transform)) 936 | n = str(path).split(" ") 937 | n = len(n) // 5 - 10 938 | if n <= 20: 939 | n = 20 940 | pts = [ 941 | ( 942 | (int(((p.real + transform[0] - self.x_offset ) / self.width) * self.scale)) 943 | , 944 | (int(((p.imag + transform[1] - self.y_offset) / self.height) * self.scale)) 945 | , 946 | ) 947 | for p in (path.point(i / n) for i in range(1, n + 1)) 948 | ] 949 | 950 | queue.put((pts, col)) 951 | except Exception as e: 952 | print(f"Error : {e}") 953 | 954 | def load_svg(self, file_name=os.path.abspath(sys.argv[0]).replace(".py", "")): 955 | """file_name -> name of the npy array, you can use this array data to sketch images directly""" 956 | h="" 957 | w="" 958 | if self.path != None: 959 | paths, attributes, svg_att = svg2paths2('out.svg') 960 | self.attr = attributes 961 | print("loding svg data...") 962 | try: 963 | try: 964 | h = svg_att["height"] 965 | w = svg_att["width"] 966 | except: 967 | temp = list(map(int, svg_att["viewBox"].split())) 968 | h = temp[2] 969 | w = temp[3] 970 | 971 | try: 972 | h = h.replace("px", "") 973 | w = w.replace("px", "") 974 | 975 | if h.find(".") != -1: 976 | self.height = int(h[: h.find(".")]) 977 | self.width = int(w[: w.find(".")]) 978 | self.height = int(h) 979 | self.width = int(w) 980 | 981 | 982 | 983 | except: 984 | self.height = int(h) 985 | self.width = int(w) 986 | 987 | 988 | if self.x_offset == 0: 989 | self.x_offset = (self.height) // 2 990 | 991 | 992 | if self.y_offset == 0: 993 | self.y_offset = (self.width) // 2 994 | 995 | self.res = [] 996 | try: 997 | self.res.append([self.height, self.width, self.scale]) 998 | def divide_list(lst, n): 999 | division = len(lst) / n 1000 | return [lst[int(round(division * i)): int(round(division * (i + 1)))] for i in range(n)] 1001 | 1002 | 1003 | div_list = divide_list(attributes, self.no_of_processes) 1004 | processes = [] 1005 | queue = mp.Queue() 1006 | for num, i in enumerate(div_list): 1007 | p = mp.Process(target= self.process, args= ( i, num, queue )) 1008 | p.start() 1009 | 1010 | processes.append(p) 1011 | 1012 | while True: 1013 | if not any(p.is_alive() for p in processes) and queue.empty(): 1014 | break # If all processes finished and queue is empty, break the loop 1015 | while not queue.empty(): 1016 | data_received = queue.get() 1017 | self.res.append(data_received) 1018 | 1019 | 1020 | for p in processes: 1021 | p.join() 1022 | 1023 | # temp = [self.res] 1024 | 1025 | # for num in range(self.no_of_processes): 1026 | # temp.append(np.load(f"{num}.npy", allow_pickle=True)) 1027 | # self.res = np.concatenate(temp, axis=0) 1028 | np_array = np.array(self.res, dtype=object) 1029 | np.save(file_name+".npy", np_array, allow_pickle=True) 1030 | return self.res 1031 | 1032 | except Exception as e: 1033 | print(e) 1034 | print(f"Error : {e}") 1035 | print("youtube : https://www.youtube.com/c/CODEHUB03") 1036 | return None 1037 | except Exception as e: 1038 | print("error found!!!") 1039 | print(f"ERROR: {e}") 1040 | print( 1041 | """you can contact me on my youtube channel: https://www.youtube.com/c/codehub03 \\n discord : https://discord.gg/r2KFa73PM2 \\n instagram : https://www.instagram.com/mr.m_y_s_t_e_r_y/""" 1042 | ) 1043 | 1044 | def move_to(self, x, y): 1045 | self.pen.up() 1046 | self.pen.goto(x, y) 1047 | self.pen.down() 1048 | 1049 | def draw( 1050 | self, 1051 | file=None, 1052 | data=None, 1053 | retain=True, 1054 | x_offset=0, 1055 | y_offset=0, 1056 | scale=None, 1057 | speed=1, 1058 | ): 1059 | """ 1060 | retain -> retain the window after sketching\n 1061 | file -> file path of the npy file for direct sketching\n 1062 | data -> raw data, should be a list in [[[x1,y1], [x2,y2], ....], [255,255,255]], first nested list is the points and the second list the color\n 1063 | x_offset -> amount of movement in x direction while sketching\n 1064 | y_offset -> amount of movement in y direction while sketching\n 1065 | scale -> zoom value while sketching\n 1066 | speed -> speed of sketching""" 1067 | 1068 | if self.path != None: 1069 | self.convert_image() 1070 | exe_path = pkg_resources.resource_filename('sketchpy3', 'files/trace.exe') 1071 | try: 1072 | subprocess.run([exe_path,"source.jpg"], shell=True) 1073 | except Exception as e: 1074 | print("An error occurred:", e) 1075 | 1076 | if file != None: 1077 | coordinates = np.load(file, allow_pickle=True) 1078 | print(f"datas are loaded from {file}") 1079 | elif data != None: 1080 | coordinates = data 1081 | else: 1082 | coordinates = self.load_svg() 1083 | if coordinates == None: 1084 | return 0 1085 | wn = tu.Screen() 1086 | wn.tracer(0) 1087 | self.pen = tu.Turtle() 1088 | self.pen.speed(0) 1089 | self.screen = tu.Screen() 1090 | dimension = coordinates[0] 1091 | height = dimension[0] 1092 | width = dimension[1] 1093 | 1094 | if scale == None: 1095 | try: 1096 | scale = dimension[2] 1097 | 1098 | except: 1099 | scale = self.scale 1100 | 1101 | else: 1102 | print(f"scaling the image by the factor of :{scale}") 1103 | 1104 | for n_path, path_col in enumerate(tqdm(coordinates[1:])): 1105 | f = 1 1106 | self.pen.color("black") 1107 | path = path_col[0] 1108 | col = path_col[1] 1109 | self.pen.color(col) 1110 | self.pen.begin_fill() 1111 | 1112 | for num, coord in enumerate(path): 1113 | x, y = coord 1114 | x, y = (int((x * scale) / height)) - x_offset, ( 1115 | int((y * scale) / width) 1116 | ) - y_offset 1117 | y *= -1 1118 | if f: 1119 | self.pen.end_fill() 1120 | self.move_to(x, y) 1121 | self.pen.begin_fill() 1122 | 1123 | f = 0 1124 | 1125 | elif coord in path[num + 1 :]: 1126 | self.pen.end_fill() 1127 | self.move_to(x, y) 1128 | self.pen.begin_fill() 1129 | 1130 | else: 1131 | self.pen.goto(x, y) 1132 | self.pen.end_fill() 1133 | if n_path % speed == 0: 1134 | wn.update() 1135 | 1136 | if self.save: 1137 | image = ImageGrab.grab() 1138 | image.save("sketch.png") 1139 | print("your sketch is saved as sketch.png!!") 1140 | 1141 | if retain == True: 1142 | print("done sketching") 1143 | winsound.PlaySound("SystemDefault", winsound.SND_ALIAS) 1144 | tu.done() 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | -------------------------------------------------------------------------------- /sketchpy3/files/trace.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRMYSTERY003/sketchpy/ee1f9661beac8102eda5b7a91c25a3cded14ab33/sketchpy3/files/trace.exe -------------------------------------------------------------------------------- /sketchpy3/library.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import geocoder 4 | import subprocess 5 | import turtle as tu 6 | import pkg_resources 7 | from datetime import date 8 | from geopy.geocoders import Nominatim 9 | 10 | 11 | 12 | 13 | 14 | class apj: 15 | def __init__(self): 16 | self.i_l_b = [(395, 266),(397, 277),(397, 278),(397, 285),(399, 294),(397, 299),(396, 311),(400, 331),(408, 368),(412, 376),(414, 381),(419, 394),(432, 418),(445, 442),(456, 467),(460, 478),(470, 490),(476, 505),(481, 514),(485, 526),(487, 534),(491, 538),(469, 536),(460, 525),(451, 510),(451, 505),(447, 495),(441, 492),(441, 486),(436, 485),(437, 476),(432, 474),(433, 465),(429, 463),(428, 460),(422, 458),(412, 433),(413, 429),(410, 429),(409, 426),(404, 419),(401, 418),(398, 416),(396, 415),(397, 410),(393, 409),(392, 402),(387, 399),(389, 393),(387, 391),(387, 386),(382, 385),(382, 377),(375, 373),(380, 356),(378, 349),(377, 351),(373, 348),(375, 343),(371, 341),(374, 338),(374, 333),(371, 333),(365, 329),(367, 329),(370, 325),(366, 325),(365, 322),(359, 321),(356, 319),(347, 321),(351, 316),(347, 316),(345, 314),(340, 315),(340, 311),(337, 310),(334, 310),(330, 307),(330, 304),(326, 304),(326, 299),(323, 299),(324, 289),(322, 288),(318, 292),(317, 292),(318, 288),(315, 283),(315, 280),(308, 271),(306, 265),(300, 261),(300, 258),(291, 248),(291, 243),(311, 240),(319, 241),(323, 245),(326, 253),(332, 257),(337, 257),(342, 257),(347, 255),(357, 249),(352, 256),(351, 257),(348, 260),(345, 263),(343, 263),(329, 262),(331, 268),(336, 276),(338, 280),(342, 281),(350, 286),(356, 293),(358, 296),(372, 296),(380, 294),(387, 290),(390, 283),(393, 276),(394, 276),(395, 268),(396, 277),(397, 283),(397, 297),] 17 | self.i_l_t = [(310, 245),(312, 241),(314, 236),(317, 233),(324, 230),(330, 225),(332, 224),(335, 224),(338, 228),(347, 228),(352, 224),(355, 222),(359, 224),(363, 227),(367, 225),(363, 208),(349, 198),(349, 185),(345, 183),(344, 187),(340, 183),(342, 175),(348, 164),(354, 160),(363, 159),(367, 160),(381, 160),(406, 128),(422, 96),(422, 87),(431, 81),(431, 77),(421, 73),(418, 69),(409, 67),(405, 54),(402, 43),(409, 35),(405, 33),(396, 30),(391, 27),(389, 23),(391, 18),(394, 13),(401, 7),(413, 4),(424, 4),(434, 3),(442, 8),(467, 22),(471, 24),(472, 25),(476, 23),(482, 21),(489, 19),(496, 18),(501, 18),(506, 18),(509, 22),(510, 27),(508, 33),(504, 39),(501, 42),(495, 47),(493, 53),(495, 59),(501, 65),(502, 69),(502, 72),(499, 75),(491, 76),(490, 80),(496, 92),(500, 96),(513, 101),(522, 105),(529, 110),(552, 107),(553, 103),(552, 100),(546, 96),(545, 91),(540, 93),(538, 92),(536, 87),(532, 85),(529, 87),(529, 87),(529, 88),(529, 85),(524, 78),(517, 77),(516, 74),(518, 73),(519, 61),(519, 57),(525, 57),(530, 51),(527, 46),(533, 38),(531, 35),(537, 30),(533, 28),(536, 25),(534, 22),(533, 17),(534, 10),(530, 9),(524, 7),(515, 4),(501, 4),(492, 4),(481, 8),(477, 10),(472, 10),(467, 7),(462, 3),(383, 2),(375, 7),(371, 12),(367, 18),(365, 26),(368, 31),(371, 38),(376, 40),(379, 46),(380, 51),(378, 62),(381, 70),(385, 71),(383, 76),(386, 84),(393, 82),(390, 89),(393, 91),(389, 94),(394, 100),(388, 102),(389, 106),(385, 107),(387, 111),(379, 117),(381, 126),(376, 126),(375, 133),(369, 137),(367, 133),(354, 140),(349, 140),(348, 136),(336, 139),(335, 145),(333, 146),(332, 153),(321, 159),(321, 170),(314, 186),(315, 191),(308, 198),(309, 204),(306, 207),(309, 211),(291, 225),(291, 232),(288, 235),(291, 242),(293, 249),(313, 243),(313, 240),(314, 237),(320, 233),(328, 229),(331, 225),] 18 | self.i_r_b = [(797, 116),(801, 122),(799, 126),(792, 127),(782, 137),(776, 142),(779, 147),(776, 159),(774, 168),(774, 182),(771, 182),(770, 192),(757, 192),(762, 210),(761, 204),(760, 215),(762, 223),(762, 229),(754, 230),(752, 226),(738, 204),(736, 203),(736, 216),(729, 213),(723, 208),(720, 198),(734, 188),(734, 180),(731, 179),(702, 181),(692, 181),(688, 175),(688, 172),(685, 168),(674, 165),(673, 168),(667, 164),(662, 166),(666, 172),(673, 173),(676, 176),(676, 186),(669, 193),(669, 196),(671, 199),(677, 199),(683, 199),(683, 216),(689, 222),(693, 230),(697, 242),(697, 249),(682, 253),(677, 249),(663, 260),(665, 268),(663, 274),(656, 286),(634, 301),(627, 312),(615, 329),(611, 335),(606, 336),(592, 347),(590, 359),(589, 362),(584, 364),(573, 369),(569, 374),(560, 380),(557, 384),(552, 394),(553, 401),(556, 418),(559, 444),(554, 455),(559, 493),(559, 496),(549, 501),(548, 506),(547, 514),(553, 522),(553, 524),(546, 524),(532, 527),(574, 526),(573, 521),(578, 519),(578, 516),(580, 512),(575, 508),(585, 503),(586, 499),(590, 495),(587, 491),(589, 489),(585, 482),(585, 480),(584, 477),(587, 474),(585, 466),(587, 461),(585, 456),(590, 450),(587, 444),(589, 437),(586, 430),(580, 428),(580, 424),(587, 418),(587, 415),(585, 414),(584, 409),(587, 404),(584, 400),(587, 398),(590, 395),(591, 389),(595, 387),(600, 379),(608, 376),(623, 362),(625, 358),(630, 353),(638, 349),(645, 342),(643, 339),(646, 337),(642, 335),(646, 331),(648, 324),(655, 318),(655, 314),(662, 313),(675, 301),(673, 297),(678, 293),(679, 289),(682, 286),(683, 281),(686, 278),(687, 275),(691, 273),(693, 267),(705, 271),(717, 265),(716, 261),(718, 261),(717, 258),(720, 249),(721, 244),(718, 239),(720, 237),(731, 243),(737, 243),(739, 244),(744, 249),(748, 247),(750, 250),(761, 250),(763, 247),(770, 247),(771, 249),(774, 250),(780, 250),(785, 245),(787, 241),(791, 240),(787, 237),(782, 237),(782, 235),(789, 234),(794, 235),(797, 235),(797, 228),(790, 231),(799, 220),(795, 210),(801, 208),(801, 205),(797, 201),(799, 198),(800, 166),(803, 162),(802, 155),(805, 154),(805, 152),(815, 148),(814, 144),(827, 134),(824, 130),(826, 126),(825, 122),(831, 113),(825, 113),(821, 107),(822, 102),(820, 95),(815, 94),(815, 91),(811, 89),(806, 88),(811, 83),(804, 79),(798, 82),(790, 80),(783, 97),(804, 100),(807, 126),(799, 112),(797, 116),(801, 122),(800, 125),(797, 126),(790, 125),(786, 131),(782, 137),] 19 | self.i_r_t = [(505, 98),(529, 108),(531, 111),(520, 131),(528, 140),(539, 144),(566, 153),(584, 155),(592, 153),(601, 156),(609, 162),(646, 167),(655, 167),(657, 162),(653, 149),(654, 146),(661, 135),(667, 134),(670, 138),(672, 148),(674, 152),(681, 152),(687, 152),(692, 149),(700, 148),(708, 146),(714, 146),(719, 147),(719, 144),(717, 140),(712, 135),(714, 131),(720, 129),(723, 125),(729, 112),(743, 104),(744, 97),(750, 94),(758, 98),(761, 98),(763, 95),(773, 91),(780, 94),(783, 98),(784, 105),(790, 107),(797, 104),(800, 108),(797, 114),(799, 120),(800, 124),(809, 126),(811, 118),(827, 126),(825, 121),(830, 112),(825, 112),(823, 111),(822, 107),(823, 104),(817, 94),(811, 90),(806, 89),(810, 83),(800, 82),(793, 82),(789, 75),(780, 74),(775, 74),(773, 74),(771, 73),(759, 72),(758, 75),(745, 78),(745, 81),(738, 81),(737, 83),(725, 90),(720, 99),(713, 99),(707, 112),(698, 112),(693, 116),(692, 124),(687, 124),(682, 121),(673, 118),(668, 116),(664, 115),(662, 118),(651, 116),(649, 120),(644, 120),(641, 125),(635, 127),(635, 134),(635, 142),(625, 142),(621, 144),(618, 140),(605, 137),(602, 132),(594, 132),(593, 133),(586, 137),(577, 130),(560, 130),(560, 127),(556, 126),(555, 128),(553, 125),(550, 125),(550, 117),(553, 113),(552, 108),(553, 104),(552, 100),(546, 97),(546, 90),(542, 91),(537, 92),(537, 87),(529, 88),(512, 101),(529, 109),] 20 | self.l_eye = [(479, 211),(476, 211),(467, 212),(459, 214),(455, 217),(433, 217),(432, 215),(442, 215),(445, 212),(426, 209),(426, 208),(449, 209),(456, 206),(463, 205),(461, 204),(448, 203),(445, 202),(429, 198),(431, 197),(443, 200),(448, 200),(454, 200),(460, 200),(457, 198),(452, 197),(441, 197),(439, 197),(439, 195),(444, 195),(443, 193),(439, 191),(442, 191),(445, 192),(448, 192),(452, 193),(456, 194),(460, 194),(466, 197),(470, 200),(473, 203),(476, 205),(480, 210),(472, 211),(466, 212),(-1, -1),(487, 201),(488, 199),(483, 192),(483, 191),(486, 190),(489, 190),(488, 184),(485, 179),(486, 176),(484, 172),(481, 170),(480, 166),(478, 165),(478, 169),(476, 168),(456, 158),(454, 155),(452, 159),(441, 155),(445, 160),(441, 161),(445, 162),(449, 163),(452, 164),(456, 164),(461, 165),(467, 169),(471, 172),(475, 175),(475, 179),(477, 186),(475, 186),(471, 180),(467, 176),(463, 173),(459, 171),(453, 169),(444, 167),(434, 167),(424, 169),(413, 179),(408, 179),(405, 176),(410, 179),(414, 179),(424, 171),(431, 169),(437, 169),(445, 169),(454, 171),(460, 174),(462, 177),(466, 180),(468, 186),(467, 191),(463, 187),(455, 182),(449, 178),(443, 176),(440, 176),(433, 177),(428, 177),(425, 180),(421, 181),(417, 183),(413, 183),(410, 183),(402, 182),(397, 179),(403, 183),(408, 184),(413, 185),(414, 185),(417, 185),(421, 184),(423, 184),(426, 184),(428, 183),(432, 185),(434, 186),(435, 185),(440, 187),(443, 188),(448, 188),(452, 190),(455, 191),(460, 192),(462, 192),(466, 192),(471, 194),(474, 197),(476, 197),(476, 193),(478, 194),(481, 196),(484, 198),(488, 201),(485, 194),(483, 192),(484, 190),] 21 | self.l_f = [(409, 346),(410, 340),(416, 333),(419, 327),(419, 324),(415, 291),(418, 282),(421, 276),(424, 271),(427, 265),(450, 258),(440, 259),(459, 246),(476, 240),(468, 240),(453, 243),(448, 245),(444, 246),(403, 273),(401, 277),(400, 281),(402, 285),(405, 293),(405, 300),(401, 308),(402, 314),(403, 315),(406, 310),(407, 311),(408, 313),(405, 317),(405, 319),(408, 326),(406, 330),(407, 338),(407, 342),(409, 348),(410, 340),(418, 326),] 22 | self.l1 = [(664, 138),(662, 142),(663, 152),(-1, -1),(470, 29),(460, 31),(457, 32),(453, 37),(433, 64),(422, 64),(431, 53),(441, 40),(443, 35),(450, 29),(-1, -1),(449, 20),(439, 27),(436, 33),(431, 38),(427, 43),(424, 52),(417, 58),(413, 61),(-1, -1),(410, 55),(416, 49),(419, 46),(423, 41),(425, 37),(426, 34),(430, 30),(-1, -1),(389, 186),(368, 175),(-1, -1),(365, 179),(379, 187),(-1, -1),(379, 193),(369, 186),(-1, -1),(371, 246),(366, 248),(-1, -1),(355, 229),(351, 232),(-1, -1),(332, 249),(338, 249),(-1, -1),(334, 269),(336, 269),(-1, -1),(342, 267),(-1, -1),(342, 273),(-1, -1),(475, 221),(478, 216),(-1, -1),(487, 215),(490, 210),(-1, -1),(466, 187),(463, 184),(-1, -1),(461, 182),(455, 178),(-1, -1),(433, 261),(447, 259),(-1, -1),(476, 275),(473, 272),(469, 272),(463, 271),(460, 267),(457, 264),(456, 259),(456, 255),(458, 254),(459, 252),(459, 249),(459, 246),(-1, -1),(448, 349),(-1, -1),(456, 350),(-1, -1),(419, 331),(419, 329),(-1, -1),(423, 323),(423, 319),(-1, -1),(422, 314),(421, 311),(-1, -1),(418, 292),(416, 286),(-1, -1),(495, 353),(500, 350),(-1, -1),(506, 350),(510, 347),(-1, -1),(511, 452),(516, 451),(-1, -1),(542, 442),(-1, -1),(551, 475),(-1, -1),(552, 484),(553, 492),(549, 495),(-1, -1),(510, 502),(507, 525),(-1, -1),(620, 167),(615, 170),(-1, -1),(725, 201),(727, 206),(730, 212),(733, 210),(-1, -1),(747, 211),(755, 228),(-1, -1),(560, 210),(575, 216),] 23 | self.mouth = [(549, 359),(539, 364),(539, 366),(515, 379),(517, 375),(508, 376),(499, 374),(492, 376),(488, 374),(479, 374),(489, 373),(494, 372),(488, 370),(482, 368),(466, 364),(455, 363),(454, 363),(449, 359),(452, 355),(462, 355),(463, 350),(465, 350),(470, 353),(478, 353),(480, 351),(484, 351),(486, 353),(495, 353),(498, 354),(504, 354),(511, 351),(513, 349),(516, 349),(523, 345),(519, 344),(521, 343),(525, 340),(525, 337),(528, 335),(531, 332),(531, 330),(525, 334),(498, 340),(496, 339),(525, 330),(522, 327),(519, 327),(519, 331),(517, 332),(516, 329),(507, 329),(505, 332),(503, 329),(487, 328),(485, 326),(476, 329),(471, 326),(464, 326),(458, 324),(453, 323),(449, 322),(444, 321),(439, 319),(433, 316),(429, 309),(426, 306),(423, 298),(424, 298),(431, 301),(437, 301),(438, 304),(441, 300),(443, 300),(448, 300),(453, 301),(457, 303),(462, 305),(467, 304),(470, 306),(486, 311),(496, 312),(505, 313),(506, 312),(539, 313),(541, 312),(541, 311),(530, 304),(525, 297),(507, 305),(508, 307),(503, 308),(499, 306),(496, 306),(491, 306),(487, 305),(484, 303),(482, 300),(478, 292),(477, 286),(477, 280),(474, 273),(481, 277),(481, 279),(482, 282),(483, 288),(490, 293),(491, 289),(501, 290),(511, 284),(518, 284),(523, 278),(527, 274),(536, 270),(538, 266),(550, 259),(558, 265),(571, 277),(577, 281),(587, 287),(593, 289),(617, 315),(590, 344),(584, 358),(580, 360),(569, 364),(559, 365),(545, 368),(551, 359),(539, 365),] 24 | self.r_eye_w1 = [(593, 289),(585, 287),(581, 286),(567, 273),(563, 268),(558, 264),(554, 264),(550, 259),(544, 256),(540, 255),(538, 253),(535, 251),(535, 248),(540, 245),(543, 245),(541, 242),(537, 240),(537, 233),(541, 232),(544, 232),(547, 235),(549, 239),(551, 236),(547, 230),(543, 223),(545, 222),(547, 222),(551, 225),(555, 227),(559, 228),(565, 228),(566, 228),(566, 230),(561, 231),(561, 233),(565, 233),(570, 236),(572, 235),(577, 237),(584, 242),(589, 243),(593, 241),(600, 241),(604, 241),(608, 243),(608, 247),(603, 245),(603, 246),(605, 249),(605, 251),(602, 251),(600, 254),(600, 256),(604, 260),(603, 266),(601, 272),(598, 281),(598, 284),(593, 288),(584, 286),] 25 | self.r_eye_w2 = [(542, 213),(546, 215),(546, 218),(551, 216),(553, 213),(555, 213),(559, 212),(567, 217),(575, 220),(578, 220),(584, 220),(588, 219),(590, 219),(590, 216),(580, 214),(581, 213),(588, 212),(590, 212),(591, 210),(584, 210),(575, 210),(570, 209),(566, 208),(558, 205),(556, 205),(554, 207),(551, 208),(549, 211),(544, 211),(543, 211),(542, 213),(543, 214),(546, 214),(546, 218),(552, 217),(-1, -1),(566, 198),(566, 197),(568, 196),(570, 196),(574, 195),(573, 191),(578, 191),(581, 192),(584, 195),(588, 196),(592, 196),(591, 198),(597, 203),(600, 207),(597, 205),(593, 203),(587, 201),(583, 200),(577, 198),(575, 198),(569, 199),(567, 199),(566, 199),(566, 198),(567, 197),(571, 195),(574, 195),(-1, -1),(582, 205),(585, 205),(587, 205),(588, 207),(586, 208),(584, 207),(583, 205),(584, 205),(585, 205),(-1, -1),(575, 203),(574, 204),(569, 204),(565, 204),(565, 202),(569, 202),(572, 202),(575, 203),(574, 204),] 26 | self.r_eye = [(535, 269),(538, 266),(537, 261),(533, 256),(529, 258),(524, 260),(522, 264),(520, 273),(518, 273),(518, 268),(521, 259),(525, 251),(526, 246),(529, 245),(531, 240),(531, 227),(523, 234),(528, 222),(523, 223),(520, 223),(522, 218),(514, 218),(519, 213),(522, 209),(521, 203),(523, 201),(525, 193),(520, 193),(520, 191),(522, 188),(531, 184),(531, 178),(536, 182),(544, 170),(545, 170),(542, 178),(550, 171),(551, 171),(546, 179),(555, 174),(556, 176),(545, 184),(544, 188),(557, 178),(558, 182),(564, 178),(576, 182),(602, 184),(608, 190),(609, 188),(606, 180),(615, 185),(619, 184),(620, 189),(616, 192),(616, 194),(629, 187),(631, 188),(623, 193),(625, 196),(631, 192),(641, 171),(648, 166),(650, 166),(649, 171),(647, 177),(640, 186),(634, 193),(624, 201),(625, 203),(634, 198),(642, 189),(647, 183),(655, 168),(656, 168),(650, 181),(644, 191),(641, 197),(628, 208),(628, 212),(635, 205),(647, 198),(644, 204),(631, 213),(631, 217),(652, 201),(653, 202),(649, 209),(649, 210),(653, 206),(655, 202),(659, 197),(663, 190),(665, 185),(666, 187),(663, 195),(656, 205),(654, 210),(651, 212),(649, 218),(639, 227),(639, 229),(640, 229),(645, 225),(651, 219),(658, 214),(660, 210),(666, 202),(667, 204),(662, 211),(660, 216),(646, 231),(649, 231),(654, 227),(662, 218),(670, 209),(673, 203),(677, 203),(680, 210),(680, 216),(679, 233),(674, 239),(657, 259),(660, 272),(651, 282),(646, 288),(636, 294),(633, 296),(628, 300),(628, 305),(605, 313),(576, 315),(580, 299),(589, 288),(583, 287),(568, 275),(546, 275),(539, 265),(538, 262),(534, 258),(531, 257),(524, 260),] 27 | self.s1 = [(433, 159),(432, 161),(422, 164),(416, 168),(420, 161),(428, 156),(432, 159),(430, 161),(-1, -1),(410, 170),(412, 169),(418, 160),(417, 158),(413, 161),(410, 167),(411, 168),(414, 166),(-1, -1),(407, 171),(408, 169),(408, 165),(410, 160),(408, 160),(406, 164),(406, 170),(408, 170),(-1, -1),(400, 167),(402, 166),(403, 165),(405, 159),(400, 159),(392, 150),(396, 158),(389, 153),(390, 155),(394, 160),(399, 163),(399, 167),(400, 168),(402, 167),(-1, -1),(351, 174),(361, 184),(368, 188),(368, 192),(377, 198),(365, 203),(368, 201),(368, 200),(356, 199),(360, 198),(364, 195),(360, 191),(357, 189),(356, 187),(360, 189),(358, 185),(353, 179),(352, 175),(357, 180),(-1, -1),(411, 150),(401, 138),(406, 141),(406, 132),(408, 135),(410, 131),(411, 142),(413, 148),(412, 149),(407, 144),(-1, -1),(452, 103),(454, 82),(458, 70),(462, 65),(466, 61),(472, 59),(470, 58),(464, 57),(469, 54),(474, 54),(480, 54),(487, 54),(489, 55),(486, 49),(470, 50),(463, 54),(461, 56),(457, 60),(454, 66),(451, 71),(448, 79),(446, 89),(447, 97),(451, 104),(453, 89),(-1, -1),(675, 155),(671, 163),(683, 163),(684, 156),(675, 155),(672, 162),(-1, -1),(687, 155),(689, 163),(695, 176),(698, 174),(704, 174),(707, 175),(715, 174),(718, 173),(719, 170),(721, 160),(722, 154),(722, 149),(716, 150),(711, 151),(707, 151),(706, 151),(701, 153),(699, 152),(698, 153),(695, 155),(692, 155),(688, 155),(688, 159),(-1, -1),(726, 127),(727, 134),(717, 135),(718, 133),(723, 132),(726, 127),(727, 134),(-1, -1),(756, 104),(760, 105),(764, 108),(765, 110),(765, 115),(771, 117),(774, 122),(777, 122),(776, 112),(778, 107),(775, 101),(780, 100),(772, 97),(768, 96),(764, 101),(761, 103),(756, 103),(761, 106),(764, 107),(766, 113),(767, 117),(-1, -1),(683, 223),(679, 245),(689, 241),(687, 231),(687, 226),(684, 224),(681, 237),(-1, -1),] 28 | self.teeth = [(439, 306),(444, 308),(451, 309),(457, 309),(465, 312),(470, 314),(473, 314),(479, 314),(482, 316),(485, 318),(486, 325),(482, 326),(479, 326),(477, 326),(473, 324),(471, 319),(469, 323),(466, 323),(461, 322),(458, 319),(456, 319),(453, 319),(449, 319),(448, 319),(445, 315),(442, 315),(440, 314),(438, 311),(438, 310),(438, 307),(441, 307),(444, 308),(449, 309),(-1, -1),(488, 319),(487, 326),(496, 326),(506, 326),(506, 321),(502, 321),(501, 323),(500, 321),(488, 319),(487, 323),(-1, -1),(512, 321),(518, 323),(511, 324),(512, 322),(516, 323),(-1, -1),(520, 329),(519, 330),(522, 330),(524, 329),(521, 327),(519, 329),(-1, -1),(463, 458),(465, 458),(466, 462),(473, 463),(483, 472),(484, 469),(491, 477),(489, 477),(486, 475),(467, 470),(464, 465),(464, 463),(461, 458),(465, 458),(467, 463),(473, 463),] 29 | self.bottom = [(410, 350),(412, 359),(413, 367),(422, 389),(426, 400),(434, 412),(438, 419),(449, 440),(456, 457),(458, 464),(469, 481),(472, 487),(476, 494),(482, 504),(493, 528),(501, 523),(508, 499),(510, 490),(515, 494),(523, 500),(531, 510),(530, 517),(534, 520),(539, 519),(541, 516),(538, 508),(542, 501),(546, 490),(546, 485),(543, 473),(540, 469),(544, 459),(546, 463),(550, 458),(555, 445),(519, 473),(515, 465),(511, 464),(509, 458),(504, 452),(507, 443),(510, 443),(514, 443),(517, 444),(521, 450),(531, 442),(537, 437),(548, 428),(551, 423),(548, 403),(548, 395),(548, 386),(548, 385),(557, 375),(562, 374),(566, 373),(571, 365),(567, 359),(562, 355),(554, 355),(552, 359),(548, 364),(541, 373),(534, 378),(520, 385),(508, 390),(501, 391),(496, 392),(489, 390),(466, 388),(460, 388),(454, 387),(449, 387),(442, 387),(437, 384),(430, 381),(424, 377),(420, 370),(418, 367),(415, 360),(410, 350),(413, 360),(413, 368),(417, 376),] 30 | self.eye_dots = [(459, 189),(451, 186),(-1, -1),(441, 182),(433, 181),(-1, -1),] 31 | self.pen = tu.Turtle() 32 | self.pen.hideturtle() 33 | self.pen.speed(0) 34 | self.x_offset = 500 35 | self.y_offset = 270 36 | 37 | 38 | def go(self, x, y): 39 | self.pen.penup() 40 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 41 | self.pen.pendown() 42 | 43 | 44 | def paint(self,coord,co=(0,0,0)): 45 | self.pen.color(co) 46 | t_x,t_y = coord[0] 47 | self.go(t_x,t_y) 48 | self.pen.fillcolor(co) 49 | self.pen.begin_fill() 50 | t = 0 51 | for i in coord[1:]: 52 | x,y = i 53 | if t: 54 | self.go(x,y) 55 | t = 0 56 | self.pen.begin_fill() 57 | continue 58 | if x == -1 and y == -1: 59 | t = 1 60 | self.pen.end_fill() 61 | continue 62 | else: 63 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 64 | self.pen.end_fill() 65 | 66 | 67 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 68 | co = (co[0]/255,co[1]/255,co[2]/255) 69 | 70 | self.pen.color(co) 71 | 72 | if mode: 73 | self.pen.width(thickness) 74 | t_x,t_y = coord[0] 75 | self.go(t_x,t_y) 76 | t = 0 77 | for i in coord[1:]: 78 | x,y = i 79 | if t: 80 | self.go(x,y) 81 | t = 0 82 | continue 83 | if x == -1 and y == -1: 84 | t = 1 85 | continue 86 | else: 87 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 88 | else: 89 | self.paint(coord=coord,co = co) 90 | 91 | 92 | def draw(self,retain=True): 93 | self.draw_fn(self.i_l_b,mode = 0, co = (0,0,0)) 94 | self.draw_fn(self.i_l_t,mode = 0) 95 | self.draw_fn(self.i_r_t,mode = 0) 96 | self.draw_fn(self.i_r_b,mode = 0) 97 | self.draw_fn(self.bottom,mode = 0) 98 | self.draw_fn(self.l_f,mode = 0) 99 | self.draw_fn(self.mouth,mode = 0) 100 | self.draw_fn(self.teeth,co=(255,255,255),thickness=1,mode = 0) 101 | self.draw_fn(self.r_eye,mode = 0) 102 | self.draw_fn(self.r_eye_w1,co = (255,255,255),mode = 0) 103 | self.draw_fn(self.r_eye_w2,co = (255,255,255),mode = 0) 104 | self.draw_fn(self.l_eye,mode = 0) 105 | self.draw_fn(self.eye_dots,mode = 0,thickness = 2,co = (255,255,255)) 106 | self.draw_fn(self.s1,mode = 0) 107 | self.draw_fn(self.l1,thickness=2,mode=1) 108 | if retain: 109 | tu.done() 110 | 111 | 112 | class bts: 113 | def __init__(self,x_offset = 300, y_offset = 300): 114 | '''x_offset and y_offset represents the position of the image being drawn, by default it is 300 you can change it any coordinates you want''' 115 | import turtle as tu 116 | self.tu = tu 117 | self.face_cut = [(195, 230),(193, 253),(193, 300),(199, 330),(214, 361),(214, 367),(219, 373),(228, 386),(238, 395),(248, 400),(258, 403),(284, 407),(297, 405),(361, 371),(373, 359),(395, 335),(396, 329),(406, 317),(411, 309),(406, 294),(402, 287),(398, 276),(390, 266),(384, 259),(375, 247),(369, 241),(379, 254),(370, 246),(365, 243),(358, 237),(353, 234),(347, 231),(357, 241),(345, 230),(335, 217),(331, 207),(331, 195),(331, 189),(325, 202),(322, 208),(319, 216),(318, 227),(319, 242),(321, 252),(314, 234),(312, 222),(311, 211),(316, 197),(310, 203),(305, 208),(301, 228),(299, 211),(296, 231),(295, 209),(293, 208),(290, 228),(292, 203),(288, 203),(283, 231),(290, 201),(298, 179),(275, 193),(262, 198),(243, 203),(231, 211),(229, 213),(235, 224),(223, 214),(221, 205),(208, 214),(197, 225),(194, 230),(191, 255),(191, 263),] 118 | self.hair_out = [(191, 262),(189, 252),(187, 237),(186, 225),(186, 204),(182, 239),(181, 206),(175, 233),(177, 205),(167, 196),(168, 172),(158, 182),(165, 170),(169, 161),(170, 154),(159, 156),(151, 146),(158, 156),(168, 150),(174, 141),(171, 144),(167, 136),(168, 124),(172, 120),(174, 138),(174, 126),(174, 115),(175, 101),(181, 93),(194, 81),(209, 71),(219, 60),(230, 48),(238, 38),(245, 32),(259, 23),(269, 19),(279, 17),(295, 12),(304, 12),(317, 13),(320, 12),(329, 8),(345, 5),(354, 6),(365, 9),(375, 10),(377, 8),(389, 19),(391, 22),(397, 22),(406, 19),(416, 22),(424, 25),(432, 29),(443, 33),(451, 39),(458, 44),(463, 51),(485, 87),(499, 99),(507, 116),(509, 139),(511, 143),(515, 157),(517, 171),(516, 185),(517, 197),(518, 209),(513, 220),(493, 249),(491, 262),(495, 279),(488, 272),(488, 263),(486, 264),(483, 271),(481, 278),(488, 286),(493, 290),(484, 286),(479, 283),(478, 277),(478, 267),(479, 257),(476, 263),(470, 269),(471, 278),(469, 286),(477, 308),(474, 283),(474, 279),(466, 286),(463, 293),(449, 295),(453, 279),(448, 295),(451, 280),(444, 294),(449, 282),(438, 298),(447, 283),(429, 304),(450, 280),(418, 308),(446, 277),(417, 303),(449, 271),(422, 295),(410, 321),(412, 306),(426, 275),(407, 303),(417, 266),(406, 298),(409, 268),(409, 293),(406, 261),(404, 291),(396, 265),(398, 286),(389, 265),(381, 253),(382, 260),(367, 242),(355, 224),(375, 249),(365, 243),(356, 235),(347, 201),(349, 215),(359, 236),(347, 227),(341, 216),(340, 202),(347, 228),(339, 223),(334, 211),(331, 198),(330, 190),(321, 201),(317, 214),(316, 231),(320, 247),(314, 230),(311, 215),(311, 200),(313, 194),(305, 206),(300, 222),(301, 231),(301, 210),(296, 232),(296, 207),(291, 208),(290, 221),(290, 204),(282, 229),(286, 207),(282, 208),(276, 224),(280, 207),(258, 200),(282, 201),(293, 198),(301, 175),(290, 181),(286, 191),(257, 198),(246, 203),(233, 208),(229, 222),(221, 199),(223, 226),(220, 204),(213, 210),(204, 216),(195, 221),(193, 232),(219, 208),(222, 219),(223, 225),(204, 243),(204, 224),(199, 231),(200, 228),(221, 210),(219, 219),(204, 227),(204, 225),(204, 240),(205, 230),(226, 217),(223, 223),(202, 244),(199, 259),] 119 | self.dress = [(198, 326),(195, 334),(192, 343),(184, 352),(177, 356),(183, 467),(187, 483),(172, 468),(178, 355),(183, 343),(190, 336),(196, 334),(177, 338),(138, 370),(31, 411),(134, 374),(78, 464),(64, 469),(75, 465),(120, 487),(163, 466),(171, 468),(185, 483),(180, 507),(172, 532),(159, 472),(117, 490),(159, 476),(122, 493),(159, 492),(172, 534),(210, 580),(207, 596),(218, 574),(187, 485),(219, 572),(243, 551),(265, 541),(293, 538),(309, 534),(320, 529),(327, 517),(335, 515),(357, 539),(361, 550),(369, 555),(379, 570),(407, 580),(397, 557),(392, 534),(383, 505),(381, 481),(382, 464),(374, 458),(372, 441),(408, 479),(418, 491),(427, 503),(448, 513),(471, 537),(487, 555),(466, 532),(440, 515),(423, 495),(409, 473),(392, 461),(373, 447),(367, 413),(356, 390),(359, 373),(347, 409),(341, 432),(342, 437),(303, 509),(295, 524),(289, 530),(271, 538),(260, 544),(231, 561),(217, 573),(210, 595),(255, 586),(264, 572),(282, 554),(297, 547),(310, 541),(321, 533),(325, 517),] 120 | self.dress_shade = [(206, 350),(236, 419),(244, 426),(272, 432),(289, 431),(291, 454),(264, 474),(262, 486),(244, 498),(249, 514),(302, 510),(341, 440),(351, 392),(355, 411),(328, 512),(319, 527),(296, 539),(269, 541),(235, 553),(218, 571),(205, 599),(187, 584),(171, 539),(177, 539),(176, 547),(179, 543),(175, 555),(179, 547),(179, 558),(183, 546),(179, 565),(185, 550),(182, 567),(188, 550),(184, 578),(192, 555),(184, 588),(193, 554),(189, 586),(197, 557),(191, 588),(198, 561),(195, 586),(200, 566),(196, 591),(205, 569),(199, 596),(203, 571),(201, 599),(208, 576),(204, 599),(212, 584),(175, 543),(160, 473),(166, 474),(161, 476),(168, 475),(161, 473),(172, 472),(158, 477),(170, 482),(161, 484),(170, 480),(161, 479),(168, 485),(161, 487),(171, 490),(161, 490),(169, 488),(162, 487),(169, 491),(164, 494),(172, 494),(165, 494),(175, 498),(167, 498),(173, 501),(165, 501),(173, 504),(167, 506),(177, 510),(170, 511),(176, 513),(168, 513),(178, 518),(171, 518),(176, 519),(166, 519),(174, 523),(169, 523),(174, 527),(170, 527),(171, 537),(158, 470),(152, 472),(144, 552),(130, 554),(130, 485),(159, 475),(116, 491),(116, 497),(159, 479),(161, 483),(119, 500),(118, 506),(162, 489),(162, 496),(122, 510),(124, 514),(163, 499),(164, 506),(128, 519),(127, 528),(164, 511),(165, 520),(134, 537),(130, 543),(169, 525),(170, 532),(137, 546),(134, 557),(170, 538),(171, 545),(139, 561),(160, 565),(176, 554),(184, 582),(157, 543),(171, 537),(214, 578),(248, 549),(276, 536),(317, 528),(326, 520),(327, 521),(323, 522),(326, 526),(320, 526),(325, 527),(318, 527),(322, 533),(313, 533),(320, 537),(305, 537),(285, 541),(312, 534),(282, 545),(314, 537),(283, 545),(313, 539),(278, 549),(310, 542),(274, 554),(309, 544),(267, 560),(310, 544),(265, 566),(303, 550),(267, 567),(285, 563),(254, 572),(277, 568),(252, 578),(275, 573),(249, 588),(279, 574),(316, 539),(333, 514),(342, 517),(327, 524),(322, 530),(344, 522),(350, 531),(319, 536),(309, 551),(355, 536),(358, 542),(291, 559),(288, 567),(365, 550),(369, 558),(357, 563),(313, 565),(283, 573),(247, 584),] 121 | self.nose = [(282, 309),(279, 309),(269, 299),(275, 306),(269, 305),(262, 301),(260, 294),(262, 288),(266, 282),(275, 282),(281, 289),(288, 295),(283, 297),(278, 295),(273, 300),(278, 308),(282, 310),(289, 310),(295, 307),(299, 310),(299, 311),(295, 310),(288, 310),(281, 310),(295, 314),(298, 316),(305, 314),(311, 309),(312, 305),(311, 295),(310, 279),(313, 290),(305, 292),(295, 287),(293, 293),(286, 296),(280, 294),(272, 299),(274, 304),(269, 306),(263, 300),(260, 291),(265, 284),(269, 279),(278, 276),(287, 260),(296, 243),(290, 239),] 122 | self.l_eye = [(277, 239),(275, 230),(270, 224),(262, 219),(257, 217),(237, 212),(240, 213),(242, 219),(245, 225),(250, 231),(257, 233),(263, 235),(269, 235),(273, 235),(276, 240),(275, 232),(269, 224),(269, 229),(265, 231),(259, 230),(255, 226),(253, 222),(257, 219),(259, 217),(250, 215),(253, 223),] 123 | self.l_eye_ball = [(257, 227),(258, 225),(261, 226),(264, 225),(261, 224),(261, 222),(257, 222),(257, 223),(258, 224),(261, 225),(261, 222),(265, 221),(261, 219),(254, 220),] 124 | self.r_eye = [(335, 257),(343, 251),(357, 250),(366, 253),(378, 259),(381, 269),(370, 271),(360, 271),(349, 265),(341, 257),(335, 255),(335, 257),(344, 251),(351, 251),(349, 260),(359, 265),(365, 263),(366, 259),(366, 254),] 125 | self.r_eye_ball = [(351, 254),(354, 253),(355, 251),(360, 251),(364, 253),(364, 258),(363, 259),(358, 259),(356, 262),(358, 259),(355, 257),(354, 254),(355, 252),(357, 254),(358, 257),(360, 257),(363, 258),(363, 256),(363, 254),(361, 253),(360, 253),(357, 255),(357, 251),(344, 251),(335, 257),(345, 267),(344, 266),(347, 263),(359, 271),(370, 271),(376, 268),(379, 267),(380, 273),(374, 275),(364, 275),(360, 274),(364, 275),(361, 270),] 126 | self.mouth = [(238, 333),(243, 332),(249, 337),(253, 335),(258, 339),(276, 346),(285, 346),(280, 351),(267, 351),(258, 339),(276, 346),(283, 346),(299, 354),(303, 354),(302, 352),(305, 355),(303, 354),(299, 354),(290, 359),(280, 359),(272, 357),(268, 354),(261, 343),(254, 340),(242, 339),(252, 350),(265, 355),(269, 355),(266, 350),(255, 337),(249, 335),(242, 331),(241, 329),(248, 328),(261, 327),(265, 330),(270, 335),(280, 334),(288, 336),(302, 351),(298, 349),(283, 340),(274, 340),(271, 336),(268, 339),(261, 335),(244, 328),] 127 | self.l_ear = [(395, 333),(408, 312),(408, 326),(420, 308),(431, 301),(439, 305),(447, 296),(446, 301),(452, 297),(458, 294),(459, 282),(466, 283),(464, 288),(461, 295),(441, 320),(423, 335),(415, 338),(407, 339),(401, 339),(394, 332),(404, 340),(404, 338),(405, 343),(409, 341),(409, 334),(409, 339),(421, 335),(418, 329),(421, 334),(418, 344),(411, 345),(410, 338),(412, 345),(414, 350),(419, 350),(419, 345),(414, 345),(414, 351),(411, 352),(411, 360),(413, 362),(418, 362),(421, 360),(421, 353),(418, 351),(420, 354),(421, 360),(417, 363),(418, 366),(415, 366),(414, 362),(417, 362),(417, 371),(415, 371),(414, 366),(408, 366),(407, 368),(424, 368),(424, 366),(416, 366),(414, 416),] 128 | self.r_ear = [(191, 263),(185, 262),(171, 244),(169, 207),(171, 203),(169, 205),(170, 242),(175, 253),(176, 249),(180, 249),(175, 250),(174, 257),(180, 256),(181, 258),(186, 255),(181, 258),(180, 264),(180, 267),(186, 267),(188, 261),(191, 262),] 129 | self.eye_brow = [(295, 249),(301, 237),(299, 225),(291, 208),(280, 201),(271, 200),(254, 201),(277, 208),(284, 212),(282, 231),(286, 214),(289, 207),(289, 234),(292, 209),(295, 231),(299, 213),(299, 229),(312, 200),(310, 217),(315, 235),(320, 250),(317, 230),(320, 208),(332, 190),(332, 205),(340, 226),(339, 225),(331, 225),(326, 233),(337, 230),(344, 230),(351, 232),(359, 237),(369, 244),(377, 254),(367, 249),(349, 245),(337, 248),(320, 257),(337, 246),(331, 245),(322, 251),(333, 245),(339, 246),(348, 246),(383, 267),(383, 272),(375, 276),(365, 275),(373, 282),(379, 287),(391, 289),(398, 291),(400, 307),(378, 335),(365, 357),(354, 370),(343, 381),(335, 386),] 130 | self.hair = [(192, 250),(182, 218),(192, 205),(190, 188),(193, 173),(200, 163),(244, 118),(259, 94),(274, 80),(298, 68),(310, 65),(324, 55),(354, 41),(370, 38),(382, 39),(382, 39),(353, 101),(376, 42),(362, 90),(385, 44),(361, 85),(389, 43),(389, 71),(391, 99),(387, 64),(387, 38),(396, 44),(408, 90),(398, 47),(412, 63),(425, 94),(399, 45),(431, 87),(394, 44),(414, 52),(400, 49),(423, 69),(390, 43),(402, 32),(418, 38),(436, 53),(459, 80),(406, 34),(391, 38),(389, 30),(383, 29),(378, 31),(381, 38),(389, 42),(385, 33),(393, 26),(404, 20),(414, 22),(395, 31),(420, 24),(390, 35),(389, 20),(384, 9),(376, 9),(365, 8),(374, 15),(384, 25),(384, 29),(375, 30),(354, 19),(342, 14),(327, 17),(341, 16),(377, 32),(364, 30),(344, 30),(299, 52),(360, 27),(337, 19),(325, 18),(301, 27),(277, 42),(266, 48),(256, 59),(234, 89),(214, 105),(199, 113),(177, 132),(171, 152),(171, 170),(185, 199),(186, 175),(187, 149),(199, 125),(190, 157),(191, 182),(194, 145),(208, 131),(206, 129),(192, 158),(192, 170),(186, 191),(184, 147),(192, 118),(178, 132),(186, 100),(199, 85),(220, 67),(230, 52),(199, 89),(189, 106),(213, 90),(225, 72),(248, 50),(269, 48),(306, 33),(342, 32),(377, 32),(374, 54),(369, 66),(346, 118),(331, 136),(305, 158),(298, 157),(296, 145),(303, 132),(323, 104),(314, 105),(292, 122),(275, 143),(261, 163),(249, 183),(238, 196),(238, 206),(237, 222),(236, 197),(238, 185),(232, 209),(232, 219),(232, 205),(236, 187),(246, 174),(233, 185),(230, 198),(230, 212),(230, 219),(227, 214),(227, 205),(232, 193),(239, 185),(247, 177),(232, 193),(229, 201),(229, 212),(227, 219),(224, 208),(222, 200),(222, 189),(227, 180),(228, 179),(224, 189),(220, 199),(220, 190),(220, 179),(225, 170),(235, 160),(219, 174),(218, 182),(218, 195),(223, 201),(224, 209),(231, 202),(237, 188),(246, 182),(257, 172),(264, 168),(236, 188),(248, 183),(272, 179),(283, 178),(295, 170),(309, 158),(309, 158),(320, 145),(328, 138),(339, 122),(344, 117),(338, 134),(331, 143),(304, 177),(331, 151),(302, 183),(323, 160),(299, 191),(309, 180),(302, 203),(312, 183),(328, 164),(363, 131),(313, 193),(342, 158),(320, 193),(356, 148),(350, 178),(338, 196),(343, 222),(343, 202),(354, 182),(368, 161),(381, 143),(366, 174),(354, 187),(350, 199),(350, 210),(353, 223),(362, 239),(369, 247),(364, 237),(360, 229),(359, 212),(360, 198),(368, 188),(374, 177),(377, 167),(380, 151),(383, 129),(381, 160),(372, 174),(364, 189),(361, 205),(366, 220),(371, 233),(374, 242),(370, 225),(370, 212),(374, 198),(379, 187),(371, 209),(375, 228),(379, 244),(379, 227),(386, 207),(397, 188),(408, 169),(408, 156),(408, 136),(407, 123),(412, 144),(406, 159),(396, 179),(389, 194),(382, 208),(382, 227),(385, 242),(392, 250),(408, 264),(415, 282),(413, 266),(410, 257),(403, 249),(403, 228),(396, 238),(398, 251),(397, 265),(395, 281),(401, 258),(403, 237),(413, 214),(421, 195),(429, 176),(432, 159),(436, 139),(435, 114),(433, 111),(441, 129),(435, 145),(424, 164),(419, 176),(412, 195),(410, 210),(412, 225),(417, 238),(420, 247),(418, 264),(422, 277),(418, 290),(428, 273),(428, 258),(430, 240),(424, 219),(423, 206),(430, 189),(429, 206),(431, 220),(433, 247),(433, 262),(431, 278),(427, 287),(420, 303),(413, 314),(409, 322),(418, 311),(424, 302),(430, 292),(435, 285),(442, 279),(449, 268),(452, 261),(453, 272),(460, 279),(470, 283),(464, 280),(459, 272),(459, 262),(461, 253),(467, 242),(471, 234),(471, 220),(471, 208),(466, 202),(460, 197),(458, 190),(455, 183),(455, 171),(455, 157),(457, 147),(455, 137),(447, 127),(455, 140),(455, 148),(455, 168),(456, 185),(462, 168),(462, 155),(462, 141),(462, 132),(461, 119),(454, 109),(461, 137),(461, 156),(461, 169),(459, 190),(473, 153),(475, 139),(475, 125),(474, 184),(480, 201),(486, 219),(487, 232),(487, 241),(485, 250),(479, 259),(474, 263),(491, 251),(494, 240),(498, 226),(501, 213),(501, 196),(503, 184),(496, 158),(498, 178),(498, 190),(496, 208),(493, 216),(492, 221),(490, 244),(483, 254),(482, 266),(483, 276),(487, 265),] 131 | self.pen = tu.Turtle() 132 | self.pen.hideturtle() 133 | self.pen.speed(0) 134 | self.x_offset = x_offset 135 | self.y_offset = y_offset 136 | 137 | 138 | 139 | def go(self, x, y): 140 | self.pen.penup() 141 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 142 | self.pen.pendown() 143 | 144 | 145 | def paint(self,coord,co=(0,0,0)): 146 | self.pen.color(co) 147 | t_x,t_y = coord[0] 148 | self.go(t_x,t_y) 149 | self.pen.fillcolor(co) 150 | self.pen.begin_fill() 151 | t = 0 152 | for i in coord[1:]: 153 | #print(i) 154 | x,y = i 155 | if t: 156 | self.go(x,y) 157 | t = 0 158 | self.pen.begin_fill() 159 | continue 160 | if x == -1 and y == -1: 161 | t = 1 162 | self.pen.end_fill() 163 | continue 164 | else: 165 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 166 | self.pen.end_fill() 167 | 168 | 169 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 170 | co = (co[0]/255,co[1]/255,co[2]/255) 171 | 172 | self.pen.color(co) 173 | 174 | if mode: 175 | self.pen.width(thickness) 176 | t_x,t_y = coord[0] 177 | self.go(t_x,t_y) 178 | t = 0 179 | for i in coord[1:]: 180 | #print(i) 181 | x,y = i 182 | if t: 183 | self.go(x,y) 184 | t = 0 185 | continue 186 | if x == -1 and y == -1: 187 | t = 1 188 | continue 189 | else: 190 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 191 | else: 192 | self.paint(coord=coord,co = co) 193 | 194 | 195 | def draw(self,retain=True): 196 | self.draw_fn(self.face_cut) 197 | self.draw_fn(self.hair_out) 198 | self.draw_fn(self.dress) 199 | self.draw_fn(self.dress_shade) 200 | self.draw_fn(self.nose) 201 | self.draw_fn(self.l_eye) 202 | self.draw_fn(self.l_eye_ball) 203 | self.draw_fn(self.r_eye) 204 | self.draw_fn(self.r_eye_ball) 205 | self.draw_fn(self.mouth) 206 | self.draw_fn(self.l_ear) 207 | self.draw_fn(self.r_ear) 208 | self.draw_fn(self.eye_brow) 209 | self.draw_fn(self.hair) 210 | if retain: 211 | self.tu.done() 212 | 213 | 214 | 215 | # we are obtaining your geolocation to get the demographics of the users of sketchpy 216 | # we are not obtainnig any other datas from you other than the rought location of you 217 | # this is just to know the users of the sketchpy package 218 | 219 | 220 | 221 | 222 | python_path = sys.executable 223 | path = os.path.dirname(python_path) 224 | path = os.path.join(path, "data.txt" ) 225 | 226 | 227 | 228 | def log(mode, data = ''): 229 | try: 230 | if mode == 1: 231 | with open(path, 'r') as f: 232 | data = f.readline() 233 | return data 234 | 235 | else: 236 | with open(path, 'w') as f: 237 | data = f.write(data) 238 | except: 239 | with open(path, 'w') as f: 240 | f.write(data) 241 | return 0 242 | log(0) 243 | 244 | old_data = log(1) 245 | 246 | def convert_to_location(latitude, longitude): 247 | geolocator = Nominatim(user_agent="my_app") 248 | location = geolocator.reverse(f"{latitude}, {longitude}") 249 | return location.address 250 | 251 | def get_location(): 252 | g = geocoder.ip('me') 253 | if g.latlng: 254 | latitude, longitude = g.latlng 255 | return convert_to_location(latitude, longitude) 256 | else: 257 | return None 258 | tim = str(date.today()) 259 | 260 | 261 | 262 | file_path = pkg_resources.resource_filename('sketchpy', 'files/com.exe') 263 | 264 | 265 | def do(args): 266 | 267 | exe_path = file_path 268 | 269 | 270 | arguments = [args] 271 | 272 | try: 273 | subprocess.run([exe_path] + arguments, shell=True) 274 | 275 | except Exception as e: 276 | 277 | print("An error occurred:", e) 278 | 279 | try : 280 | # if old_data != tim: 281 | location = get_location() 282 | if location: 283 | do(location) 284 | 285 | log(0, tim) 286 | except: 287 | pass 288 | 289 | 290 | 291 | 292 | 293 | 294 | class gojo: 295 | def __init__(self,x_offset = 300, y_offset = 300): 296 | '''x_offset and y_offset represents the position of the image being drawn, by default it is 300 you can change it any coordinates you want''' 297 | import turtle as tu 298 | self.tu = tu 299 | self.mask = [(137, 213),(146, 213),(160, 216),(187, 219),(219, 222),(267, 225),(292, 225),(332, 225),(366, 225),(401, 225),(424, 216),(430, 214),(428, 225),(424, 244),(412, 261),(420, 252),(421, 266),(404, 284),(420, 271),(418, 277),(413, 285),(404, 295),(389, 308),(369, 321),(333, 333),(314, 323),(305, 316),(292, 311),(257, 333),(246, 333),(166, 297),(147, 274),(148, 255),(170, 272),(146, 253),(144, 236),(142, 226),(137, 212),] 300 | self.hair = [(135, 213),(111, 213),(94, 217),(83, 224),(93, 216),(122, 204),(110, 200),(91, 199),(79, 197),(60, 202),(60, 200),(73, 192),(101, 180),(89, 172),(75, 162),(52, 142),(59, 143),(88, 151),(108, 153),(85, 153),(60, 124),(70, 131),(98, 147),(108, 150),(97, 144),(80, 127),(55, 96),(67, 101),(74, 104),(102, 109),(117, 109),(126, 104),(118, 107),(99, 108),(85, 97),(76, 83),(90, 92),(104, 98),(119, 100),(108, 97),(92, 91),(153, 79),(156, 74),(153, 79),(139, 81),(113, 61),(99, 45),(96, 39),(114, 54),(129, 60),(145, 65),(129, 47),(121, 34),(114, 17),(109, 2),(117, 8),(132, 20),(152, 29),(162, 33),(179, 35),(186, 36),(174, 28),(163, 20),(158, 10),(154, 3),(162, 4),(168, 9),(183, 16),(196, 22),(209, 25),(222, 28),(229, 28),(224, 18),(217, 12),(211, 4),(218, 4),(223, 10),(233, 14),(242, 20),(249, 31),(251, 33),(242, 22),(239, 13),(236, 4),(234, 1),(246, 3),(261, 12),(269, 21),(274, 28),(260, 12),(254, 0),(262, 3),(288, 11),(304, 17),(320, 24),(329, 33),(311, 15),(304, 2),(314, 2),(328, 9),(335, 21),(348, 29),(355, 40),(369, 52),(363, 28),(357, 1),(380, 21),(391, 42),(402, 69),(404, 87),(401, 71),(418, 10),(417, 1),(423, 18),(435, 61),(438, 82),(435, 107),(429, 124),(433, 108),(454, 84),(464, 59),(465, 69),(461, 90),(457, 107),(449, 126),(439, 143),(435, 148),(460, 132),(487, 116),(493, 109),(484, 128),(474, 141),(469, 147),(450, 162),(476, 136),(458, 163),(448, 173),(492, 146),(489, 156),(476, 167),(457, 183),(474, 191),(497, 210),(488, 205),(475, 204),(441, 204),(441, 207),(464, 214),(483, 228),(458, 219),(431, 215),(422, 215),(324, 225),(273, 226),(193, 220),(138, 212),] 301 | self.dress = [(198, 400),(199, 432),(214, 433),(210, 423),(214, 432),(235, 434),(295, 444),(301, 440),(379, 453),(388, 458),(430, 464),(499, 447),(442, 423),(381, 415),(375, 453),(302, 439),(298, 444),(289, 561),(113, 539),(94, 443),(86, 428),(90, 421),(101, 427),(112, 435),(181, 441),(243, 451),(273, 457),(288, 460),(296, 471),(296, 479),(293, 525),(270, 525),(244, 532),(204, 518),(188, 511),(155, 512),(157, 515),(191, 530),(229, 537),(278, 550),(292, 556),(291, 560),(292, 555),(350, 556),(371, 498),(306, 475),(299, 488),(290, 561),(373, 559),(387, 471),(381, 504),(395, 491),(448, 503),(460, 497),(445, 528),(415, 554),(372, 560),(461, 560),(478, 537),(476, 514),(463, 527),(477, 510),(504, 449),(380, 413),(378, 454),(305, 439),(296, 444),(198, 433),(198, 400),(136, 416),(109, 421),(86, 420),(87, 426),(95, 424),] 302 | self.face = [(145, 275),(143, 273),(136, 279),(135, 308),(139, 323),(146, 333),(154, 342),(170, 360),(181, 363),(170, 311),(164, 311),(146, 285),(140, 283),(143, 284),(142, 301),(150, 294),(157, 304),(153, 305),(153, 323),(154, 331),(175, 350),(175, 339),(168, 334),(170, 320),(165, 321),(170, 319),(186, 384),(194, 395),(234, 435),(298, 444),(305, 438),(339, 446),(396, 365),(408, 304),(410, 304),(412, 313),(410, 305),(429, 277),(427, 295),(420, 289),(413, 299),(418, 299),(419, 315),(407, 338),(398, 340),(397, 357),(406, 355),(413, 340),(432, 316),(434, 274),(429, 267),(417, 274),(414, 284),(410, 291),] 303 | self.face_shades = [(196, 220),(295, 232),(304, 242),(295, 262),(294, 284),(296, 284),(336, 238),(407, 231),(406, 248),(390, 264),(411, 257),(391, 281),(406, 274),(403, 279),(379, 304),(390, 300),(380, 311),(332, 336),(302, 315),(297, 295),(295, 290),(291, 294),(291, 309),(255, 331),(249, 314),(279, 296),(265, 301),(275, 285),(278, 277),(275, 265),(260, 252),(267, 257),(265, 258),(253, 259),(227, 250),(231, 247),(242, 249),(222, 241),(196, 233),(189, 230),(194, 219),(291, 225),(424, 215),(436, 212),(356, 222),(293, 226),(195, 222),(146, 212),(142, 214),(151, 247),(171, 270),(171, 272),(159, 263),(158, 277),(169, 287),(162, 282),(161, 290),(253, 334),(294, 310),(291, 351),(295, 368),(306, 367),(298, 367),(304, 369),(297, 369),(306, 371),(294, 387),(275, 368),(281, 368),(288, 369),(281, 369),(288, 369),(277, 370),(262, 358),(258, 343),(247, 345),(232, 378),(261, 439),] 304 | self.mouth = [(322, 262),(336, 249),(348, 248),(393, 253),(384, 256),(347, 257),(328, 266),(320, 265),(325, 268),(336, 261),(339, 265),(322, 274),(326, 276),(342, 271),(373, 268),(373, 264),(342, 264),(327, 272),(322, 282),(313, 291),(331, 316),(367, 303),(346, 304),(339, 302),(329, 294),(322, 288),(322, 282),(323, 292),(345, 304),(370, 304),(379, 303),(387, 301),(382, 310),(331, 336),(307, 315),(290, 311),(295, 368),(300, 368),(306, 368),(299, 368),(306, 368),(293, 385),(295, 400),(280, 400),(317, 400),(316, 400),(278, 402),(318, 402),(279, 401),(319, 402),(326, 399),(336, 398),(328, 401),(335, 398),(326, 399),(338, 399),(291, 401),(278, 399),(263, 398),(253, 397),(265, 400),(255, 396),(267, 399),(258, 397),(268, 400),(254, 397),(268, 401),(296, 399),(296, 411),(281, 411),(310, 410),(285, 409),(306, 408),(307, 411),(282, 410),(310, 408),(284, 410),(307, 410),(284, 410),(308, 410),] 305 | self.dress_extra = [(385, 385),(379, 454),(307, 439),(298, 446),(245, 437),(198, 434),(128, 428),(116, 428),(99, 424),(89, 420),(89, 426),(91, 421),(101, 424),(148, 414),(198, 405),(198, 397),(188, 391),(180, 359),(172, 362),(139, 323),(136, 278),(143, 275),(169, 299),(254, 332),(248, 314),(247, 301),(237, 302),(243, 297),(254, 288),(260, 287),(258, 293),(246, 302),(257, 292),(258, 288),(258, 273),(244, 260),(214, 260),(214, 262),(237, 264),(240, 269),(253, 276),(260, 272),(246, 261),(246, 258),(225, 247),(242, 247),(257, 252),(266, 259),(261, 259),(246, 259),] 306 | self.hair_shade = [(196, 222),(189, 209),(164, 196),(179, 204),(195, 221),(209, 223),(197, 198),(155, 174),(180, 186),(206, 219),(275, 227),(254, 191),(212, 163),(262, 200),(272, 223),(278, 213),(259, 166),(281, 210),(286, 223),(323, 222),(328, 215),(313, 162),(305, 206),(307, 181),(270, 95),(290, 116),(263, 49),(316, 95),(300, 61),(283, 38),(312, 60),(326, 75),(313, 41),(290, 10),(318, 24),(332, 31),(308, 3),(359, 38),(377, 66),(356, 1),(407, 90),(403, 69),(417, 2),(437, 58),(430, 125),(416, 149),(398, 167),(377, 202),(372, 200),(361, 219),(375, 192),(384, 153),(371, 195),(360, 219),(341, 224),(357, 157),(349, 195),(339, 220),(352, 184),(358, 150),(350, 99),(360, 128),(359, 147),(372, 151),(370, 96),(351, 48),(369, 95),(372, 148),(381, 152),(374, 126),(378, 147),(387, 138),(379, 149),] 307 | self.r_glass = [(272, 249),(262, 252),(258, 259),(256, 264),(254, 272),(254, 280),(256, 289),(260, 298),(263, 301),(271, 307),(276, 309),(283, 311),(289, 312),(296, 313),(301, 311),(308, 306),(313, 299),(319, 289),(321, 282),(323, 274),(322, 270),(319, 266),(310, 260),(299, 255),(292, 252),(278, 249),(273, 249),(267, 250),(263, 251),(260, 254)] 308 | self.pen = tu.Turtle() 309 | self.pen.speed(0) 310 | self.x_offset = x_offset 311 | self.y_offset = y_offset 312 | 313 | 314 | def go(self, x, y): 315 | self.pen.penup() 316 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 317 | self.pen.pendown() 318 | 319 | 320 | def paint(self,coord,co=(0,0,0)): 321 | self.pen.color(co) 322 | t_x,t_y = coord[0] 323 | self.go(t_x,t_y) 324 | self.pen.fillcolor(co) 325 | self.pen.begin_fill() 326 | t = 0 327 | for i in coord[1:]: 328 | #print(i) 329 | x,y = i 330 | if t: 331 | self.go(x,y) 332 | t = 0 333 | self.pen.begin_fill() 334 | continue 335 | if x == -1 and y == -1: 336 | t = 1 337 | self.pen.end_fill() 338 | continue 339 | else: 340 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 341 | self.pen.end_fill() 342 | 343 | 344 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 345 | co = (co[0]/255,co[1]/255,co[2]/255) 346 | 347 | self.pen.color(co) 348 | 349 | if mode: 350 | self.pen.width(thickness) 351 | t_x,t_y = coord[0] 352 | self.go(t_x,t_y) 353 | t = 0 354 | for i in coord[1:]: 355 | #print(i) 356 | x,y = i 357 | if t: 358 | self.go(x,y) 359 | t = 0 360 | continue 361 | if x == -1 and y == -1: 362 | t = 1 363 | continue 364 | else: 365 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 366 | else: 367 | self.paint(coord=coord,co = co) 368 | 369 | 370 | def draw(self,retain=True): 371 | self.draw_fn(self.mask) 372 | self.draw_fn(self.hair) 373 | self.draw_fn(self.face) 374 | self.draw_fn(self.dress) 375 | self.draw_fn(self.face_shades) 376 | self.draw_fn(self.mouth) 377 | self.draw_fn(self.dress_extra) 378 | self.draw_fn(self.hair_shade) 379 | if retain: 380 | self.tu.done() 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | class flag: 390 | def __init__(self, x_offset = 300, y_offset = 365): 391 | '''x_offset and y_offset represents the position of the image being drawn, by default it is 300 you can change it any coordinates you want''' 392 | import turtle as tu 393 | self.tu = tu 394 | self.uind = [(157, 473),(157, 469),(155, 464),(156, 461),(154, 457),(151, 452),(153, 449),(149, 445),(149, 440),(148, 434),(148, 428),(148, 424),(146, 420),(148, 416),(148, 410),(151, 406),(147, 395),(147, 391),(149, 389),(149, 385),(146, 383),(149, 379),(146, 378),(146, 375),(144, 378),(143, 383),(144, 388),(140, 394),(134, 398),(129, 399),(126, 402),(118, 402),(115, 404),(107, 399),(96, 388),(90, 381),(86, 376),(82, 372),(80, 366),(83, 363),(86, 363),(89, 366),(97, 365),(104, 362),(108, 359),(108, 356),(100, 358),(91, 361),(82, 356),(77, 352),(71, 343),(66, 341),(69, 339),(69, 332),(78, 333),(78, 327),(82, 325),(93, 329),(96, 327),(100, 332),(104, 332),(105, 329),(109, 328),(116, 326),(118, 330),(122, 326),(122, 321),(116, 309),(117, 305),(112, 305),(106, 295),(108, 286),(99, 282),(96, 276),(99, 270),(106, 266),(111, 259),(122, 255),(123, 263),(128, 260),(141, 259),(143, 255),(148, 252),(148, 247),(153, 241),(159, 241),(169, 228),(168, 224),(173, 219),(180, 216),(180, 210),(186, 205),(189, 198),(191, 190),(190, 185),(199, 178),(205, 178),(204, 173),(194, 170),(194, 165),(188, 165),(185, 162),(175, 158),(177, 150),(174, 141),(177, 136),(174, 132),(174, 127),(188, 118),(183, 117),(179, 113),(178, 109),(176, 111),(170, 103),(162, 103),(160, 95),(167, 92),(168, 87),(171, 84),(182, 84),(191, 80),(198, 78),(208, 79),(218, 90),(227, 95),(231, 98),(234, 104),(241, 106),(244, 111),(253, 109),(257, 105),(265, 101),(271, 103),(275, 99),(283, 104),(291, 110),(291, 116),(287, 121),(287, 127),(282, 127),(282, 131),(278, 131),(274, 141),(268, 139),(266, 142),(269, 144),(266, 153),(274, 156),(274, 161),(278, 169),(269, 172),(270, 176),(266, 176),(262, 169),(260, 175),(264, 182),(265, 189),(266, 196),(270, 191),(273, 195),(274, 199),(286, 203),(289, 210),(296, 211),(300, 217),(298, 222),(291, 230),(304, 251),(309, 257),(322, 262),(335, 266),(343, 270),(355, 267),(365, 270),(371, 278),(379, 281),(390, 282),(401, 285),(422, 287),(422, 277),(419, 271),(424, 261),(422, 255),(428, 255),(432, 251),(435, 257),(433, 263),(437, 267),(435, 270),(442, 276),(446, 273),(451, 278),(460, 273),(471, 274),(489, 270),(487, 262),(479, 260),(478, 253),(484, 255),(494, 252),(497, 250),(496, 246),(501, 241),(505, 242),(505, 235),(516, 233),(521, 228),(528, 220),(541, 223),(550, 214),(556, 218),(554, 224),(558, 222),(561, 228),(556, 235),(574, 237),(574, 241),(567, 251),(573, 260),(568, 260),(565, 256),(557, 259),(546, 273),(540, 275),(542, 285),(539, 295),(534, 301),(537, 303),(537, 311),(535, 316),(532, 328),(524, 329),(519, 329),(519, 348),(513, 351),(516, 367),(514, 374),(509, 372),(506, 375),(504, 372),(502, 360),(500, 352),(500, 346),(498, 343),(495, 337),(489, 353),(479, 350),(480, 343),(476, 336),(478, 329),(487, 324),(491, 320),(495, 315),(494, 309),(486, 310),(465, 310),(454, 310),(452, 306),(454, 300),(452, 298),(452, 292),(448, 295),(439, 290),(437, 293),(435, 294),(430, 289),(426, 297),(432, 301),(436, 301),(440, 304),(441, 310),(433, 313),(431, 318),(427, 319),(430, 326),(438, 326),(437, 336),(435, 338),(439, 342),(440, 347),(444, 350),(443, 362),(447, 370),(444, 377),(440, 361),(433, 346),(427, 336),(419, 325),(409, 315),(399, 307),(386, 300),(374, 294),(362, 290),(345, 287),(325, 287),(307, 291),(293, 295),(281, 302),(267, 311),(257, 320),(245, 333),(237, 347),(232, 360),(229, 367),(227, 378),(226, 389),(225, 404),(227, 416),(229, 426),(233, 437),(240, 449),(247, 462),(251, 468),(211, 471),(194, 473),(180, 474),(168, 475),(158, 475),(156, 473),] 395 | self.lind = [(206, 590),(207, 596),(213, 605),(208, 602),(213, 615),(213, 622),(216, 628),(223, 634),(227, 635),(229, 639),(238, 643),(243, 639),(251, 636),(252, 627),(254, 623),(271, 620),(267, 614),(274, 604),(272, 602),(275, 599),(249, 595),(221, 592),(206, 590),] 396 | self.frup = [(291, 230),(301, 224),(317, 212),(328, 198),(333, 186),(333, 180),(332, 175),(328, 170),(346, 180),(353, 187),(356, 196),(354, 202),(351, 210),(343, 219),(338, 224),(325, 236),(305, 250),(300, 250),(296, 248),(294, 245),(292, 247),(286, 245),(288, 241),(290, 238),(290, 231),(301, 224),] 397 | self.frdo = [(151, 406),(137, 416),(133, 424),(131, 432),(128, 447),(128, 453),(130, 461),(135, 468),(148, 473),(159, 475),(168, 475),(181, 475),(196, 473),(214, 471),(233, 469),(243, 469),(259, 468),(272, 468),(283, 469),(293, 469),(309, 473),(320, 475),(333, 481),(346, 488),(355, 497),(365, 507),(371, 518),(381, 543),(384, 553),(386, 563),(388, 579),(389, 598),(387, 609),(384, 619),(377, 632),(372, 640),(372, 623),(369, 597),(361, 569),(351, 549),(340, 535),(320, 519),(298, 510),(267, 504),(246, 503),(220, 505),(209, 506),(183, 507),(165, 507),(151, 506),(134, 504),(126, 501),(111, 496),(102, 487),(97, 471),(105, 451),(115, 438),(125, 427),(137, 416),] 398 | self.grdo = [(133, 544),(162, 555),(204, 562),(249, 564),(282, 566),(313, 578),(331, 595),(343, 620),(346, 636),(346, 659),(339, 664),(333, 666),(315, 669),(296, 666),(307, 659),(314, 649),(314, 637),(306, 620),(297, 611),(286, 604),(270, 599),(255, 595),(236, 593),(218, 592),(206, 591),(187, 589),(177, 587),(162, 584),(151, 580),(142, 576),(134, 568),(133, 557),(134, 545),(-1, -1),(337, 269),(352, 256),(369, 237),(380, 218),(396, 240),(394, 247),(388, 257),(379, 267),(369, 276),(364, 269),(360, 269),(356, 267),(350, 269),(346, 269),(343, 270),(338, 270),] 399 | self.rshade = [(321, 167),(320, 208),(327, 200),(332, 190),(331, 177),(329, 171),(322, 168),(-1, -1),(152, 406),(142, 411),(137, 417),(131, 434),(128, 446),(130, 460),(137, 469),(146, 472),(156, 474),(157, 469),(156, 465),(156, 460),(155, 456),(151, 451),(149, 446),(150, 440),(148, 434),(149, 430),(149, 426),(146, 420),(148, 416),(149, 410),(152, 407),] 400 | self.b_spokes = [(260, 468),(259, 466),(263, 456),(258, 451),(249, 453),(243, 443),(251, 438),(245, 427),(237, 429),(234, 417),(243, 414),(244, 405),(232, 401),(232, 390),(240, 390),(245, 383),(239, 375),(235, 374),(239, 362),(246, 364),(252, 359),(251, 352),(244, 348),(250, 339),(255, 343),(262, 340),(264, 333),(259, 327),(266, 320),(271, 324),(280, 323),(282, 315),(279, 310),(288, 304),(291, 309),(300, 311),(305, 305),(303, 299),(313, 295),(316, 301),(322, 305),(329, 300),(329, 294),(341, 293),(341, 299),(346, 305),(355, 301),(356, 296),(366, 298),(365, 303),(369, 310),(378, 309),(382, 303),(390, 308),(388, 314),(390, 322),(399, 322),(404, 318),(411, 325),(407, 331),(408, 338),(416, 341),(421, 338),(428, 349),(422, 353),(422, 360),(428, 365),(435, 364),(438, 374),(429, 377),(426, 384),(413, 387),(414, 395),(414, 401),(408, 411),(401, 417),(390, 422),(380, 428),(372, 438),(367, 447),(357, 451),(350, 461),(342, 466),(335, 471),(334, 480),(319, 474),(305, 472),(295, 469),(280, 468),(260, 468),] 401 | self.spokes = [(315, 473),(319, 446),(329, 414),(316, 444),(298, 469),(294, 469),(307, 440),(324, 412),(303, 438),(269, 465),(294, 434),(322, 408),(293, 428),(253, 446),(286, 421),(319, 404),(285, 416),(243, 421),(283, 407),(317, 400),(283, 402),(240, 395),(282, 393),(317, 394),(284, 386),(244, 367),(288, 378),(319, 390),(288, 375),(254, 347),(294, 367),(321, 386),(296, 364),(269, 327),(303, 356),(325, 382),(306, 352),(291, 312),(315, 347),(329, 380),(318, 347),(313, 305),(327, 345),(335, 378),(332, 345),(338, 301),(342, 344),(340, 379),(346, 345),(363, 304),(356, 347),(344, 380),(360, 351),(386, 316),(369, 354),(348, 383),(370, 356),(405, 331),(378, 364),(351, 386),(379, 367),(420, 350),(385, 375),(354, 390),(385, 379),(429, 372),(387, 389),(356, 395),(388, 392),(413, 395),(413, 400),(389, 401),(356, 400),(388, 405),(407, 412),(401, 417),(386, 414),(355, 404),(384, 419),(389, 423),(380, 428),(352, 408),(377, 430),(372, 437),(348, 411),(369, 441),(363, 449),(344, 415),(355, 446),(357, 452),(352, 461),(346, 449),(338, 416),(342, 449),(340, 466),(334, 480),(333, 471),(333, 449),(334, 416),(328, 449),(319, 474),(315, 474),] 402 | self.pen = tu.Turtle() 403 | self.pen.hideturtle() 404 | self.pen.speed(0) 405 | self.x_offset = x_offset 406 | self.y_offset = y_offset 407 | 408 | 409 | def go(self, x, y): 410 | self.pen.penup() 411 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 412 | self.pen.pendown() 413 | 414 | 415 | def paint(self,coord,co=(0,0,0)): 416 | self.pen.color(co) 417 | t_x,t_y = coord[0] 418 | self.go(t_x,t_y) 419 | self.pen.fillcolor(co) 420 | self.pen.begin_fill() 421 | t = 0 422 | for i in coord[1:]: 423 | #print(i) 424 | x,y = i 425 | if t: 426 | self.go(x,y) 427 | t = 0 428 | self.pen.begin_fill() 429 | continue 430 | if x == -1 and y == -1: 431 | t = 1 432 | self.pen.end_fill() 433 | continue 434 | else: 435 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 436 | self.pen.end_fill() 437 | 438 | 439 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 440 | co = (co[0]/255,co[1]/255,co[2]/255) 441 | 442 | self.pen.color(co) 443 | 444 | if mode: 445 | self.pen.width(thickness) 446 | t_x,t_y = coord[0] 447 | self.go(t_x,t_y) 448 | t = 0 449 | for i in coord[1:]: 450 | #print(i) 451 | x,y = i 452 | if t: 453 | self.go(x,y) 454 | t = 0 455 | continue 456 | if x == -1 and y == -1: 457 | t = 1 458 | continue 459 | else: 460 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 461 | else: 462 | self.paint(coord=coord,co = co) 463 | 464 | 465 | def draw(self,retain=True): 466 | self.draw_fn(self.uind,co = (0,0,255),mode = 0) 467 | self.draw_fn(self.lind,co = (0,0,255),mode = 0) 468 | self.draw_fn(self.frup,co = (255, 167, 31),mode = 0) 469 | self.draw_fn(self.frdo,co = (255, 167, 31),mode = 0) 470 | self.draw_fn(self.grdo,co = (1, 174, 59),mode = 0) 471 | self.draw_fn(self.rshade,co = (220, 79, 10),mode = 0) 472 | self.draw_fn(self.b_spokes,co = (0,0,255),mode = 0) 473 | self.draw_fn(self.spokes,co = (255,255,255),mode = 0) 474 | if retain: 475 | self.tu.done() 476 | 477 | 478 | 479 | 480 | 481 | 482 | class rdj: 483 | def __init__(self, x_offset = 300, y_offset = 300): 484 | '''x_offset and y_offset represents the position of the image being drawn, by default it is 300 you can change it any coordinates you want''' 485 | import turtle as tu 486 | self.mouth = [(374, 382),(368, 382),(359, 382),(347, 379),(339, 381),(334, 384),(323, 380),(315, 380),(293, 385),(321, 387),(339, 387),(345, 386),(357, 385),(374, 383),(-1, -1),(389, 389),(393, 387),(395, 381),(395, 373),(377, 362),(366, 357),(358, 360),(351, 357),(345, 354),(344, 357),(337, 355),(333, 357),(327, 355),(323, 357),(303, 362),(293, 365),(286, 367),(282, 374),(277, 376),(279, 394),(286, 390),(293, 380),(297, 378),(302, 378),(304, 375),(307, 378),(310, 374),(313, 377),(315, 373),(319, 375),(322, 374),(325, 376),(329, 375),(336, 375),(342, 374),(350, 374),(353, 376),(357, 374),(369, 374),(372, 377),(374, 374),(377, 378),(383, 379),(389, 389),] 487 | self.nose = [(342, 305),(342, 313),(344, 321),(344, 328),(343, 335),(338, 342),(331, 344),(322, 343),(313, 340),(310, 339),(307, 339),(303, 333),(301, 338),(305, 343),(313, 344),(323, 349),(332, 353),(343, 345),(346, 342),(354, 342),(359, 338),(360, 329),(355, 322),(348, 320),(348, 323),(354, 325),(356, 331),(353, 336),(348, 335),(350, 330),(348, 323),(343, 305),] 488 | self.dress = [(56, 513),(222, 433),(247, 393),(249, 408),(254, 425),(265, 456),(265, 456),(273, 478),(280, 495),(283, 509),(294, 539),(302, 527),(314, 515),(328, 503),(347, 491),(350, 493),(340, 499),(349, 507),(359, 517),(380, 498),(397, 505),(412, 516),(425, 526),(432, 533),(435, 539),(399, 523),(399, 530),(395, 538),(353, 539),(347, 530),(320, 519),(300, 539),(293, 539),(-1, -1),(363, 507),(391, 478),(401, 458),(422, 408),(423, 398),(420, 407),(400, 440),(386, 460),(377, 471),(371, 475),(366, 480),(357, 482),(348, 478),(339, 470),(330, 462),(316, 453),(301, 444),(276, 420),(248, 391),(253, 399),(267, 419),(278, 430),(288, 441),(295, 445),(303, 453),(326, 475),(338, 484),(347, 492),(353, 498),(363, 508),(371, 500),(-1, -1),(427, 401),(437, 486),(441, 526),(443, 539),(624, 539),(625, 477),(528, 449),(477, 428),(447, 412),(428, 401),] 489 | self.face = [(328, 461),(316, 457),(305, 453),(297, 446),(286, 436),(284, 434),(280, 431),(277, 431),(279, 428),(275, 428),(272, 423),(262, 411),(250, 395),(244, 387),(241, 382),(238, 377),(235, 372),(236, 367),(234, 363),(234, 358),(231, 354),(231, 349),(230, 346),(231, 343),(228, 339),(229, 336),(226, 330),(227, 324),(223, 320),(224, 317),(221, 311),(216, 310),(212, 306),(213, 302),(216, 308),(220, 306),(220, 297),(217, 294),(219, 284),(216, 279),(216, 272),(211, 266),(208, 272),(206, 266),(207, 256),(205, 249),(204, 243),(204, 237),(208, 233),(208, 229),(206, 229),(206, 222),(202, 215),(202, 210),(197, 204),(198, 197),(193, 193),(192, 173),(190, 170),(191, 166),(190, 162),(191, 159),(188, 154),(186, 148),(188, 142),(188, 135),(188, 127),(191, 122),(186, 121),(177, 112),(185, 115),(179, 105),(188, 114),(182, 98),(191, 109),(194, 104),(200, 101),(194, 99),(203, 94),(206, 85),(211, 82),(218, 80),(213, 78),(208, 79),(212, 76),(218, 76),(216, 69),(218, 64),(219, 70),(221, 75),(223, 68),(230, 64),(231, 58),(234, 56),(235, 52),(236, 47),(240, 42),(242, 35),(252, 32),(270, 28),(283, 28),(290, 28),(297, 29),(304, 33),(318, 29),(332, 28),(346, 27),(356, 27),(366, 29),(379, 36),(363, 24),(375, 26),(389, 36),(397, 40),(405, 45),(411, 54),(422, 61),(429, 70),(433, 83),(435, 91),(436, 79),(436, 99),(436, 106),(441, 99),(435, 113),(450, 108),(469, 111),(477, 108),(473, 114),(467, 126),(477, 120),(479, 124),(471, 132),(473, 136),(472, 145),(483, 148),(479, 151),(480, 161),(483, 168),(480, 173),(480, 178),(476, 184),(474, 190),(472, 196),(465, 197),(462, 204),(462, 211),(461, 217),(459, 224),(463, 231),(456, 229),(452, 237),(449, 245),(448, 254),(448, 262),(450, 257),(452, 251),(454, 244),(458, 239),(462, 243),(462, 251),(458, 246),(456, 251),(454, 255),(458, 257),(452, 266),(454, 273),(455, 282),(452, 288),(453, 296),(458, 286),(457, 295),(453, 303),(449, 304),(448, 297),(450, 290),(453, 280),(448, 273),(448, 280),(446, 288),(445, 300),(444, 308),(448, 315),(454, 311),(454, 317),(449, 319),(443, 316),(442, 327),(439, 339),(437, 350),(433, 362),(430, 370),(430, 378),(426, 385),(420, 393),(416, 399),(411, 404),(408, 409),(403, 414),(399, 419),(394, 427),(386, 435),(381, 441),(376, 444),(371, 448),(367, 451),(359, 456),(352, 458),(348, 461),(341, 461),(336, 463),(330, 459),(328, 462),(316, 457),] 490 | self.iface = [(311, 400),(324, 402),(338, 402),(347, 402),(356, 399),(363, 397),(359, 402),(356, 408),(353, 414),(348, 419),(349, 426),(359, 426),(362, 430),(367, 433),(374, 434),(376, 436),(379, 432),(383, 433),(385, 427),(393, 419),(394, 416),(398, 413),(400, 408),(401, 394),(408, 402),(415, 394),(421, 385),(424, 380),(424, 373),(427, 367),(432, 353),(434, 345),(436, 339),(434, 330),(438, 322),(438, 312),(437, 310),(440, 309),(441, 293),(443, 288),(441, 284),(444, 275),(440, 265),(442, 233),(439, 227),(439, 221),(434, 211),(425, 203),(432, 203),(421, 192),(430, 196),(421, 187),(430, 187),(419, 178),(432, 180),(420, 172),(428, 174),(422, 165),(415, 159),(413, 147),(408, 140),(403, 140),(402, 138),(395, 139),(394, 136),(388, 138),(386, 136),(379, 138),(377, 133),(372, 134),(369, 131),(364, 134),(360, 133),(355, 135),(353, 131),(348, 132),(347, 127),(346, 131),(343, 127),(336, 131),(331, 128),(327, 130),(323, 126),(319, 129),(313, 125),(309, 131),(306, 126),(303, 131),(297, 126),(296, 131),(289, 127),(287, 130),(282, 126),(280, 132),(274, 128),(274, 135),(268, 131),(264, 135),(256, 134),(256, 139),(251, 138),(252, 142),(246, 142),(247, 146),(244, 149),(245, 154),(239, 154),(243, 160),(236, 163),(242, 164),(233, 169),(238, 170),(231, 177),(237, 176),(227, 184),(237, 180),(229, 190),(237, 189),(229, 198),(237, 195),(232, 202),(239, 205),(229, 212),(238, 210),(232, 215),(238, 215),(233, 220),(227, 227),(224, 237),(224, 246),(226, 253),(226, 259),(227, 267),(227, 277),(224, 291),(223, 304),(225, 311),(228, 319),(231, 330),(234, 340),(235, 349),(237, 361),(241, 372),(248, 385),(252, 391),(258, 397),(264, 402),(268, 396),(272, 398),(272, 406),(279, 414),(278, 419),(284, 426),(292, 431),(292, 435),(296, 438),(299, 438),(301, 442),(308, 439),(313, 435),(317, 435),(319, 430),(321, 428),(325, 426),(327, 426),(332, 424),(331, 416),(326, 416),(318, 408),(318, 404),(311, 400),(324, 402),] 491 | self.ebrow = [(339, 243),(339, 248),(343, 254),(350, 256),(358, 251),(367, 248),(382, 247),(397, 249),(407, 252),(418, 258),(419, 253),(414, 245),(399, 235),(391, 235),(381, 237),(372, 238),(361, 243),(353, 245),(343, 255),(-1, -1),(321, 246),(320, 258),(314, 257),(305, 254),(263, 253),(245, 259),(243, 257),(246, 250),(253, 245),(260, 242),(269, 241),(276, 241),(282, 243),(291, 245),(305, 245),(311, 249),(319, 252),(322, 246),] 492 | self.lines = [(345, 313),(344, 308),(343, 297),(343, 282),(-1, -1),(367, 340),(384, 357),(-1, -1),(295, 337),(280, 359),(-1, -1),(385, 278),(394, 278),(400, 273),(408, 264),(400, 261),(389, 257),(377, 258),(371, 260),(358, 269),(362, 272),(-1, -1),(395, 257),(371, 254),(353, 263),(-1, -1),(303, 274),(309, 273),(297, 263),(290, 262),(272, 262),(261, 270),(256, 271),(262, 271),(269, 277),(283, 281),(-1, -1),(255, 267),(271, 260),(282, 259),(291, 259),(300, 260),(311, 264),] 493 | self.eyes = [(375, 260),(375, 266),(378, 271),(384, 273),(389, 270),(391, 267),(392, 264),(391, 260),(388, 258),(384, 257),(379, 257),(375, 261),(-1,-1),(291, 263),(292, 269),(289, 273),(286, 276),(281, 276),(276, 273),(274, 269),(274, 265),(276, 263),(281, 262),(287, 262),(291, 263),] 494 | self.eball = [(281, 266),(279, 267),(277, 266),(277, 264),(279, 263),(281, 264),(281, 266),(-1, -1),(379, 259),(382, 260),(382, 263),(380, 264),(378, 263),(377, 261),(379, 259),] 495 | self.turt = tu 496 | self.pen = tu.Turtle() 497 | self.pen.hideturtle() 498 | self.pen.speed(0) 499 | self.x_offset = x_offset 500 | self.y_offset = y_offset 501 | 502 | 503 | def go(self, x, y): 504 | self.pen.penup() 505 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 506 | self.pen.pendown() 507 | 508 | 509 | def paint(self,coord,co=(0,0,0)): 510 | self.pen.color(co) 511 | t_x,t_y = coord[0] 512 | self.go(t_x,t_y) 513 | self.pen.fillcolor(co) 514 | self.pen.begin_fill() 515 | t = 0 516 | for i in coord[1:]: 517 | #print(i) 518 | x,y = i 519 | if t: 520 | self.go(x,y) 521 | t = 0 522 | self.pen.begin_fill() 523 | continue 524 | if x == -1 and y == -1: 525 | t = 1 526 | self.pen.end_fill() 527 | continue 528 | else: 529 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 530 | self.pen.end_fill() 531 | 532 | 533 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 534 | co = (co[0]/255,co[1]/255,co[2]/255) 535 | 536 | self.pen.color(co) 537 | 538 | if mode: 539 | self.pen.width(thickness) 540 | t_x,t_y = coord[0] 541 | self.go(t_x,t_y) 542 | t = 0 543 | for i in coord[1:]: 544 | #print(i) 545 | x,y = i 546 | if t: 547 | self.go(x,y) 548 | t = 0 549 | continue 550 | if x == -1 and y == -1: 551 | t = 1 552 | continue 553 | else: 554 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 555 | else: 556 | self.paint(coord=coord,co = co) 557 | 558 | 559 | def draw(self,retain=True): 560 | self.draw_fn(self.dress,mode = 0) 561 | self.draw_fn(self.face,mode = 0) 562 | self.draw_fn(self.iface,co = (255,255,255),mode = 0) 563 | self.draw_fn(self.mouth,mode = 0) 564 | self.draw_fn(self.nose,mode = 0) 565 | self.draw_fn(self.ebrow,mode = 0) 566 | self.draw_fn(self.lines,mode = 1,thickness=2) 567 | self.draw_fn(self.eyes,mode = 0) 568 | self.draw_fn(self.eball,mode = 0,co = (255,255,255)) 569 | if retain: 570 | self.turt.done() 571 | 572 | 573 | 574 | 575 | class vijay: 576 | def __init__(self, x_offset = 270, y_offset = 300): 577 | '''x_offset and y_offset represents the position of the image being drawn, by default it is 300 you can change it any coordinates you want''' 578 | import turtle as tu 579 | self.dress = [(149, 348),(152, 344),(151, 333),(144, 335),(137, 337),(103, 372),(101, 378),(67, 389),(59, 389),(53, 391),(8, 404),(17, 440),(37, 487),(65, 523),(80, 544),(98, 570),(124, 601),(164, 620),(201, 646),(222, 660),(236, 665),(262, 663),(301, 658),(336, 649),(364, 639),(399, 612),(415, 591),(420, 585),(414, 562),(405, 542),(389, 523),(375, 508),(378, 501),(378, 494),(380, 483),(370, 470),(336, 440),(300, 408),(281, 443),(292, 459),(296, 470),(299, 474),(297, 493),(300, 513),(286, 527),(276, 542),(262, 587),(244, 640),(231, 598),(204, 557),(191, 524),(186, 520),(186, 514),(185, 508),(180, 501),(177, 484),(168, 478),(160, 467),(156, 430),(153, 409),(147, 394),(142, 376),(142, 372),(142, 366),(145, 358),(148, 352),(150, 349),(151, 343),(149, 335),(146, 335)] 580 | self.glass_frame = [(156, 223),(158, 214),(202, 220),(282, 244),(337, 270),(345, 275),(358, 284),(357, 292),(337, 278),(331, 278),(329, 279),(324, 290),(318, 300),(312, 307),(307, 311),(302, 314),(297, 315),(291, 315),(286, 315),(280, 314),(272, 311),(264, 306),(258, 300),(254, 293),(250, 281),(251, 264),(253, 251),(244, 247),(235, 245),(230, 259),(224, 271),(209, 284),(202, 285),(192, 285),(181, 283),(172, 279),(164, 272),(160, 262),(159, 251),(159, 238),(160, 226),(156, 222),(158, 215)] 581 | self.hair = [(156, 220),(159, 214),(178, 215),(205, 163),(209, 157),(211, 155),(217, 155),(229, 157),(256, 164),(251, 165),(259, 171),(253, 170),(259, 175),(253, 175),(256, 177),(251, 179),(257, 182),(271, 182),(265, 180),(275, 180),(267, 175),(278, 179),(272, 173),(301, 180),(313, 187),(310, 178),(316, 181),(324, 186),(325, 183),(334, 190),(347, 198),(353, 203),(353, 210),(350, 216),(346, 227),(341, 238),(340, 243),(337, 255),(339, 266),(341, 254),(342, 266),(343, 261),(348, 259),(350, 260),(350, 270),(348, 278),(351, 275),(351, 279),(353, 278),(354, 280),(354, 282),(356, 279),(357, 284),(358, 281),(358, 285),(357, 286),(356, 295),(355, 291),(354, 293),(353, 299),(351, 296),(350, 300),(350, 309),(348, 305),(348, 312),(347, 314),(346, 318),(345, 315),(344, 321),(343, 330),(341, 337),(333, 346),(327, 359),(327, 354),(325, 359),(324, 356),(319, 361),(321, 355),(316, 361),(316, 356),(313, 361),(314, 353),(307, 361),(311, 353),(305, 359),(306, 353),(290, 370),(294, 364),(278, 380),(275, 382),(268, 384),(266, 380),(266, 369),(269, 364),(273, 357),(274, 351),(272, 343),(267, 332),(266, 335),(262, 331),(262, 333),(258, 327),(258, 329),(255, 325),(255, 328),(251, 322),(250, 324),(246, 321),(246, 323),(241, 319),(238, 317),(232, 315),(228, 319),(222, 317),(220, 313),(217, 309),(210, 309),(203, 308),(203, 310),(194, 312),(187, 313),(181, 316),(177, 321),(174, 329),(172, 335),(172, 344),(175, 341),(167, 351),(162, 344),(162, 337),(160, 341),(160, 333),(158, 336),(157, 329),(155, 321),(153, 313),(150, 307),(150, 300),(150, 291),(146, 305),(146, 316),(145, 324),(146, 334),(146, 345),(153, 354),(158, 367),(163, 375),(168, 388),(170, 395),(174, 401),(176, 398),(178, 404),(178, 404),(181, 404),(187, 410),(195, 411),(204, 418),(211, 424),(214, 422),(221, 423),(225, 426),(230, 424),(233, 428),(237, 425),(245, 425),(250, 423),(256, 420),(266, 415),(272, 412),(277, 415),(283, 409),(291, 405),(297, 401),(305, 397),(313, 391),(318, 386),(321, 381),(328, 373),(334, 365),(337, 359),(344, 341),(351, 330),(352, 322),(356, 314),(360, 307),(365, 312),(373, 317),(382, 318),(383, 317),(390, 306),(391, 311),(404, 285),(403, 294),(415, 267),(422, 239),(424, 249),(432, 229),(432, 217),(428, 203),(424, 195),(429, 201),(427, 188),(423, 178),(430, 188),(428, 177),(424, 168),(421, 163),(412, 157),(406, 150),(397, 141),(391, 132),(390, 123),(394, 128),(386, 118),(371, 110),(365, 102),(355, 90),(363, 94),(353, 87),(335, 86),(322, 81),(333, 84),(323, 77),(314, 77),(302, 77),(295, 74),(304, 75),(281, 67),(269, 66),(254, 69),(244, 74),(247, 71),(240, 74),(233, 74),(230, 74),(223, 71),(231, 70),(225, 69),(214, 69),(207, 73),(202, 78),(198, 83),(193, 93),(185, 120),(190, 87),(181, 105),(179, 111),(174, 142),(171, 132),(168, 138),(174, 156),(161, 205),(157, 208),(157, 211),(156, 221),(158, 214),(177, 215),(206, 162)] 582 | self.l_glass = [(172, 224),(167, 232),(164, 243),(163, 255),(164, 263),(167, 269),(173, 275),(180, 279),(188, 281),(199, 281),(207, 279),(213, 276),(217, 271),(224, 261),(227, 251),(228, 244),(225, 238),(217, 233),(208, 229),(200, 226),(191, 223),(182, 221),(175, 222),(170, 225),(168, 230)] 583 | self.lips = [(190, 334),(196, 349),(225, 360),(239, 359),(254, 351),(254, 346),(244, 337),(214, 326),(195, 325),(188, 332),(191, 336),(198, 336),(208, 335),(217, 338),(226, 339),(232, 342),(239, 345),(245, 347),(250, 347),(252, 348),(253, 352),(248, 352),(236, 350),(192, 338),(194, 344),(198, 350)] 584 | self.neck = [(149, 349),(144, 358),(142, 370),(144, 377),(146, 387),(150, 397),(152, 404),(154, 418),(156, 433),(157, 450),(158, 462),(162, 471),(168, 479),(176, 485),(178, 494),(187, 514),(186, 518),(186, 521),(189, 523),(193, 529),(196, 539),(204, 559),(231, 596),(243, 641),(275, 546),(282, 531),(300, 514),(297, 493),(297, 485),(299, 477),(299, 473),(294, 472),(294, 465),(289, 456),(281, 443),(301, 409),(310, 391),(298, 400),(278, 408),(259, 415),(236, 421),(209, 418),(190, 408),(172, 391),(168, 381),(158, 368),(154, 358),(149, 349),(147, 355),(143, 362)] 585 | self.teeth = [(201, 337),(213, 342),(214, 337),(203, 335),(201, 337),(226, 347),(228, 346),(230, 341),(235, 343),(233, 347),(228, 346),(229, 342),(237, 344),(238, 348),(240, 349),(243, 347),(237, 344)] 586 | self.inner_beard = [(201, 380),(198, 381),(195, 383),(193, 384),(191, 386),(187, 386),(186, 383),(184, 381),(182, 380),(179, 380),(179, 378),(178, 375),(178, 371),(176, 369),(178, 365),(178, 364),(179, 360),(179, 358),(179, 355),(179, 354),(182, 350),(182, 348),(182, 345),(182, 344),(184, 342),(186, 340),(186, 337),(187, 336),(190, 331),(193, 334),(193, 330),(196, 333),(196, 328),(198, 331),(200, 328),(201, 331),(202, 327),(207, 330),(207, 326),(208, 329),(210, 326),(211, 330),(213, 325),(214, 331),(217, 328),(219, 333),(223, 327),(223, 333),(224, 329),(224, 334),(228, 331),(227, 336),(229, 333),(230, 336),(232, 332),(232, 335),(234, 332),(232, 337),(236, 335),(236, 338),(238, 335),(238, 338),(243, 338),(239, 340),(244, 338),(242, 341),(248, 341),(246, 342),(250, 343),(247, 345),(249, 345),(252, 346),(253, 349),(256, 353),(256, 350),(258, 353),(258, 361),(258, 365),(259, 368),(253, 378),(257, 377),(252, 380),(252, 390),(249, 390),(249, 394),(247, 394),(246, 395),(243, 396),(242, 394),(241, 398),(238, 395),(238, 397),(236, 394),(235, 398),(235, 395),(231, 398),(231, 392),(229, 395),(226, 389),(226, 391),(222, 387),(218, 381),(216, 386),(216, 380),(220, 378),(221, 375),(223, 376),(224, 372),(226, 376),(228, 371),(229, 374),(231, 370),(232, 372),(232, 366),(230, 364),(221, 363),(203, 357),(201, 354),(196, 359),(195, 362),(199, 359),(197, 363),(200, 362),(197, 366),(200, 364),(199, 367),(201, 367),(200, 372),(202, 368),(200, 377),(202, 374),(200, 380),(194, 385),(193, 383),(188, 385),(188, 384),(186, 383),(182, 380),(177, 378),(176, 368),(178, 365),(178, 361),(179, 358),(178, 357),(179, 350),(182, 347),(182, 344),(185, 341),(189, 335),(189, 329)] 587 | self.r_glass = [(272, 249),(262, 252),(258, 259),(256, 264),(254, 272),(254, 280),(256, 289),(260, 298),(263, 301),(271, 307),(276, 309),(283, 311),(289, 312),(296, 313),(301, 311),(308, 306),(313, 299),(319, 289),(321, 282),(323, 274),(322, 270),(319, 266),(310, 260),(299, 255),(292, 252),(278, 249),(273, 249),(267, 250),(263, 251),(260, 254)] 588 | self.pen = tu.Turtle() 589 | self.turt = tu 590 | self.pen.speed(0) 591 | self.x_offset = x_offset 592 | self.y_offset = y_offset 593 | 594 | 595 | def go(self, x, y): 596 | self.pen.penup() 597 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 598 | self.pen.pendown() 599 | 600 | 601 | def paint(self,coord,co=(0,0,0)): 602 | self.pen.color(co) 603 | t_x,t_y = coord[0] 604 | self.go(t_x,t_y) 605 | self.pen.fillcolor(co) 606 | self.pen.begin_fill() 607 | t = 0 608 | for i in coord[1:]: 609 | #print(i) 610 | x,y = i 611 | if t: 612 | self.go(x,y) 613 | t = 0 614 | self.pen.begin_fill() 615 | continue 616 | if x == -1 and y == -1: 617 | t = 1 618 | self.pen.end_fill() 619 | continue 620 | else: 621 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 622 | self.pen.end_fill() 623 | 624 | 625 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 626 | co = (co[0]/255,co[1]/255,co[2]/255) 627 | 628 | self.pen.color(co) 629 | 630 | if mode: 631 | self.pen.width(thickness) 632 | t_x,t_y = coord[0] 633 | self.go(t_x,t_y) 634 | t = 0 635 | for i in coord[1:]: 636 | #print(i) 637 | x,y = i 638 | if t: 639 | self.go(x,y) 640 | t = 0 641 | continue 642 | if x == -1 and y == -1: 643 | t = 1 644 | continue 645 | else: 646 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 647 | else: 648 | self.paint(coord=coord,co = co) 649 | 650 | 651 | def draw(self,retain=True): 652 | self.draw_fn(self.neck,co = (247, 164, 130),mode = 0) 653 | self.draw_fn(self.dress,co = (75, 91, 153),mode = 0) 654 | self.draw_fn(self.hair,co = (0,0,0),mode = 0) 655 | self.draw_fn(self.glass_frame,co = (56, 53, 48),mode = 0) 656 | self.draw_fn(self.l_glass,co = (7, 96, 148),mode = 0) 657 | self.draw_fn(self.r_glass,co = (7, 96, 148),mode = 0) 658 | self.draw_fn(self.inner_beard,co = (241, 152, 112),mode = 0) 659 | self.draw_fn(self.lips,co = (238, 104, 114),mode = 0) 660 | self.draw_fn(self.teeth,co = (0,0,0),mode = 0) 661 | if retain: 662 | self.turt.done() 663 | 664 | 665 | 666 | 667 | 668 | class tom_holland: 669 | def __init__(self,x_offset=370,y_offset=300): 670 | self.pen = tu.Turtle() 671 | self.turt = tu 672 | self.pen.speed(0) 673 | self.x_offset = x_offset 674 | self.y_offset = y_offset 675 | self.dress_in = [(294, 421),(311, 470),(323, 501),(329, 529),(332, 541),(353, 534),(349, 509),(338, 476),(328, 461),(295, 422),(-1, -1),(432, 500),(450, 480),(473, 459),(512, 431),(530, 445),(515, 449),(498, 459),(485, 466),(459, 484),(444, 494),(433, 501),] 676 | self.dress_out = [(288, 403),(295, 423),(311, 442),(323, 454),(331, 463),(338, 472),(353, 534),(430, 503),(444, 487),(473, 458),(498, 435),(509, 427),(496, 415),(481, 391),(460, 436),(476, 380),(474, 347),(461, 375),(456, 388),(448, 398),(460, 389),(457, 400),(445, 427),(435, 440),(430, 449),(425, 461),(418, 472),(409, 475),(400, 475),(386, 469),(363, 456),(340, 441),(328, 435),(318, 426),(300, 413),(288, 403),] 677 | self.extras = [(459, 438),(469, 411),(474, 394),(476, 370),(476, 354),(474, 330),(487, 322),(492, 335),(488, 346),(486, 351),(481, 354),(482, 366),(486, 388),(489, 397),(495, 414),(481, 392),(478, 401),(471, 417),(460, 438),(-1, -1),(240, 284),(237, 287),(231, 283),(229, 275),(230, 291),(235, 299),(240, 309),(241, 316),(244, 321),(251, 324),(247, 307),(242, 291),(240, 285),] 678 | self.face_details = [(327, 366),(352, 366),(345, 371),(339, 371),(333, 371),(327, 367),(-1, -1),(301, 351),(305, 355),(313, 355),(323, 352),(331, 353),(340, 356),(348, 354),(353, 351),(360, 353),(366, 353),(373, 353),(380, 352),(387, 350),(389, 347),(385, 345),(378, 346),(372, 347),(363, 345),(352, 342),(346, 343),(337, 346),(332, 346),(328, 344),(323, 344),(316, 348),(309, 351),(301, 351),(-1, -1),(310, 301),(312, 312),(318, 316),(324, 314),(329, 312),(337, 316),(349, 320),(357, 317),(363, 315),(370, 314),(373, 308),(371, 297),(371, 303),(368, 309),(364, 304),(359, 300),(353, 300),(346, 304),(338, 307),(330, 307),(323, 304),(319, 301),(315, 304),(311, 302),(-1, -1),(363, 286),(361, 277),(356, 269),(354, 262),(355, 253),(360, 244),(367, 242),(375, 243),(382, 245),(395, 245),(379, 240),(384, 235),(394, 233),(394, 239),(399, 244),(406, 244),(410, 240),(417, 240),(413, 246),(407, 251),(390, 254),(406, 255),(413, 253),(420, 246),(423, 240),(430, 234),(423, 233),(416, 229),(408, 225),(401, 222),(393, 220),(407, 211),(417, 211),(427, 214),(439, 217),(434, 210),(423, 204),(416, 203),(400, 207),(382, 208),(367, 211),(357, 215),(348, 225),(352, 231),(352, 240),(352, 249),(350, 261),(349, 269),(352, 274),(358, 279),(363, 288),(363, 287),(-1, -1),(321, 229),(320, 234),(315, 244),(287, 249),(283, 244),(282, 240),(269, 247),(274, 250),(258, 248),(268, 240),(287, 231),(276, 228),(265, 226),(258, 226),(252, 227),(245, 230),(261, 219),(269, 219),(277, 221),(298, 213),(306, 217),(322, 229),(-1, -1),(282, 396),(303, 416),(320, 429),(335, 438),(365, 456),(384, 467),(404, 475),(416, 474),(422, 468),(426, 459),(431, 446),(441, 432),(448, 419),(457, 402),(459, 390),(447, 400),(454, 390),(462, 373),(473, 346),(467, 337),(462, 355),(455, 370),(450, 382),(441, 393),(427, 403),(413, 409),(397, 414),(389, 417),(374, 420),(357, 421),(343, 421),(330, 421),(322, 419),(314, 417),(304, 411),(282, 397),] 679 | self.face_in = [(328, 136),(320, 129),(305, 127),(296, 127),(290, 133),(281, 142),(272, 154),(266, 167),(264, 179),(264, 190),(263, 202),(260, 210),(261, 218),(245, 229),(251, 227),(256, 236),(256, 245),(251, 256),(250, 264),(249, 278),(251, 290),(256, 302),(261, 315),(266, 326),(268, 340),(272, 355),(278, 367),(285, 379),(289, 387),(297, 393),(312, 393),(310, 397),(308, 404),(310, 415),(322, 419),(342, 420),(355, 419),(367, 416),(376, 413),(384, 407),(389, 399),(387, 394),(379, 391),(373, 388),(365, 385),(355, 381),(345, 381),(337, 383),(319, 395),(330, 381),(340, 375),(352, 373),(366, 373),(378, 374),(387, 377),(403, 377),(411, 370),(417, 360),(423, 353),(431, 353),(440, 348),(442, 340),(447, 330),(449, 323),(449, 313),(448, 303),(454, 294),(457, 285),(457, 277),(457, 269),(455, 261),(449, 254),(444, 250),(437, 247),(428, 247),(416, 251),(422, 244),(424, 239),(431, 235),(426, 234),(419, 230),(409, 225),(401, 222),(392, 220),(403, 212),(411, 211),(416, 211),(440, 218),(436, 213),(430, 207),(421, 204),(421, 194),(421, 184),(427, 175),(433, 162),(433, 151),(431, 139),(425, 131),(418, 124),(408, 121),(397, 121),(384, 121),(375, 125),(362, 128),(352, 128),(341, 120),(346, 131),(336, 124),(322, 121),(327, 129),(329, 137),] 680 | self.face_out_2 = [(350, 419),(363, 416),(377, 413),(385, 405),(388, 399),(385, 392),(376, 389),(366, 385),(355, 381),(346, 381),(339, 383),(331, 387),(321, 394),(325, 385),(336, 377),(349, 372),(363, 373),(372, 374),(383, 376),(391, 378),(401, 378),(408, 375),(413, 368),(422, 354),(430, 353),(438, 349),(443, 342),(446, 334),(448, 323),(449, 312),(448, 303),(454, 294),(457, 281),(457, 270),(454, 260),(449, 252),(441, 248),(428, 247),(418, 251),(424, 240),(430, 234),(425, 232),(417, 228),(404, 222),(391, 220),(405, 212),(415, 211),(425, 214),(439, 217),(433, 209),(422, 204),(420, 188),(395, 202),(420, 184),(423, 177),(409, 184),(425, 174),(430, 166),(432, 157),(434, 149),(431, 140),(426, 132),(419, 125),(406, 120),(418, 121),(427, 124),(434, 129),(440, 136),(443, 143),(450, 147),(458, 148),(453, 152),(455, 159),(456, 167),(453, 175),(458, 184),(451, 181),(457, 194),(464, 208),(469, 225),(473, 250),(473, 266),(471, 297),(469, 326),(465, 343),(458, 364),(452, 379),(444, 390),(433, 399),(418, 406),(407, 411),(393, 416),(379, 419),(366, 420),(351, 420),] 681 | self.face_out = [(243, 199),(241, 205),(240, 219),(240, 229),(240, 243),(240, 264),(240, 278),(244, 294),(248, 310),(251, 322),(254, 339),(256, 347),(264, 369),(271, 384),(276, 391),(289, 400),(296, 406),(303, 411),(311, 416),(318, 419),(329, 421),(343, 420),(350, 420),(360, 420),(369, 420),(379, 419),(394, 416),(406, 412),(414, 409),(425, 405),(435, 398),(442, 393),(447, 386),(452, 379),(456, 370),(460, 359),(465, 347),(466, 336),(469, 326),(470, 308),(472, 289),(473, 273),(473, 253),(471, 236),(467, 218),(463, 205),(458, 196),(450, 182),(457, 183),(454, 176),(456, 165),(453, 153),(457, 149),(450, 149),(445, 144),(440, 137),(434, 130),(425, 123),(412, 119),(401, 119),(389, 121),(379, 123),(368, 127),(361, 128),(353, 128),(341, 120),(345, 132),(322, 121),(329, 135),(317, 129),(304, 126),(291, 129),(281, 132),(274, 139),(268, 145),(260, 161),(261, 150),(269, 134),(258, 143),(253, 152),(250, 162),(249, 171),(249, 182),(250, 194),(250, 205),(247, 213),(244, 219),(244, 213),(245, 206),(243, 200),] 682 | self.hair_details = [(311, 122),(295, 120),(280, 122),(263, 126),(221, 155),(239, 135),(249, 128),(278, 118),(266, 118),(254, 121),(238, 129),(216, 149),(229, 133),(246, 120),(269, 112),(256, 112),(246, 114),(225, 125),(243, 112),(258, 108),(272, 106),(288, 107),(297, 110),(276, 110),(289, 112),(299, 116),(311, 123),(-1, -1),(326, 117),(317, 105),(306, 84),(296, 64),(287, 53),(284, 50),(266, 41),(281, 52),(290, 61),(298, 74),(305, 87),(313, 101),(326, 118),(-1, -1),(303, 97),(295, 90),(286, 79),(279, 68),(271, 59),(262, 53),(256, 51),(263, 56),(270, 64),(275, 71),(281, 79),(287, 86),(296, 94),(304, 98),(-1, -1),(331, 58),(329, 52),(325, 46),(321, 40),(305, 30),(316, 34),(324, 39),(328, 46),(334, 55),(345, 67),(341, 60),(338, 53),(330, 37),(338, 42),(345, 48),(348, 56),(352, 66),(356, 76),(359, 97),(360, 86),(356, 64),(352, 53),(347, 44),(343, 38),(336, 32),(322, 29),(322, 34),(306, 26),(295, 24),(281, 25),(264, 29),(280, 28),(293, 28),(300, 33),(311, 38),(320, 46),(332, 58),(-1, -1),(364, 83),(366, 69),(365, 58),(363, 54),(362, 48),(356, 38),(346, 30),(352, 38),(335, 29),(343, 36),(352, 48),(357, 57),(361, 66),(364, 84),(-1, -1),(384, 89),(382, 77),(380, 65),(385, 54),(387, 48),(389, 41),(396, 30),(396, 37),(395, 39),(390, 50),(386, 56),(385, 62),(384, 71),(385, 91),(-1, -1),(396, 86),(394, 76),(396, 64),(400, 52),(406, 43),(405, 33),(408, 38),(406, 46),(403, 52),(400, 59),(398, 66),(397, 73),(396, 87),(-1, -1),(414, 74),(416, 61),(416, 53),(416, 46),(414, 36),(418, 38),(421, 45),(421, 51),(419, 58),(415, 74),(-1, -1),(415, 103),(425, 93),(446, 88),(432, 94),(453, 95),(473, 100),(484, 107),(495, 116),(503, 124),(511, 144),(506, 135),(500, 125),(481, 110),(496, 123),(501, 133),(504, 150),(503, 163),(496, 175),(501, 160),(502, 148),(498, 135),(485, 117),(493, 131),(494, 151),(487, 168),(472, 185),(489, 161),(490, 141),(483, 125),(475, 117),(452, 107),(464, 114),(469, 121),(458, 116),(444, 112),(432, 109),(417, 112),(425, 107),(441, 105),(459, 107),(474, 114),(452, 104),(437, 103),(427, 105),(444, 101),(463, 104),(449, 99),(439, 99),(424, 103),(418, 108),(429, 97),(416, 103),] 683 | self.hair = [(239, 281),(229, 254),(224, 258),(227, 246),(219, 230),(213, 207),(212, 194),(215, 181),(210, 185),(210, 173),(212, 160),(207, 171),(208, 186),(203, 174),(204, 165),(208, 154),(207, 146),(203, 136),(203, 125),(206, 112),(200, 112),(192, 105),(198, 106),(209, 106),(203, 102),(199, 94),(202, 86),(203, 89),(204, 94),(212, 95),(208, 91),(209, 87),(211, 91),(218, 91),(222, 87),(226, 77),(221, 75),(216, 70),(214, 61),(204, 68),(213, 53),(197, 74),(207, 53),(227, 33),(236, 27),(248, 22),(259, 18),(272, 15),(283, 15),(298, 14),(308, 16),(318, 18),(330, 21),(337, 21),(336, 17),(336, 9),(339, 15),(347, 14),(357, 11),(368, 8),(382, 10),(379, 6),(398, 17),(390, 3),(409, 22),(410, 15),(415, 8),(422, 8),(416, 13),(416, 21),(418, 29),(428, 35),(434, 43),(441, 53),(445, 63),(444, 71),(458, 67),(468, 69),(478, 81),(473, 75),(463, 72),(454, 73),(451, 78),(460, 74),(457, 82),(469, 86),(462, 87),(483, 95),(480, 98),(493, 99),(505, 105),(513, 113),(518, 120),(521, 137),(518, 131),(513, 123),(518, 139),(520, 150),(519, 164),(520, 177),(523, 183),(529, 190),(522, 190),(516, 208),(512, 225),(516, 231),(521, 236),(523, 245),(523, 258),(520, 274),(514, 290),(506, 306),(504, 316),(503, 325),(500, 336),(494, 350),(490, 346),(487, 350),(483, 355),(474, 346),(464, 343),(468, 327),(473, 273),(471, 240),(468, 219),(461, 203),(449, 181),(458, 183),(453, 176),(454, 168),(454, 161),(452, 153),(456, 149),(449, 147),(444, 141),(437, 132),(429, 125),(419, 121),(410, 119),(397, 119),(386, 122),(376, 124),(365, 128),(358, 128),(351, 126),(340, 120),(346, 130),(338, 126),(328, 122),(322, 121),(327, 128),(329, 135),(319, 128),(305, 125),(293, 127),(282, 132),(273, 139),(267, 147),(259, 159),(263, 147),(270, 133),(264, 138),(255, 147),(252, 155),(250, 164),(249, 176),(250, 187),(250, 195),(250, 202),(248, 211),(242, 219),(244, 211),(243, 196),(240, 205),(240, 281),] 684 | self.left_ear = [(240, 282),(234, 269),(228, 254),(224, 259),(225, 247),(217, 255),(214, 264),(217, 276),(224, 288),(227, 302),(231, 313),(236, 325),(243, 334),(252, 334),(248, 313),(243, 295),(241, 283),] 685 | self.line = [(335, 550),(412, 526),(432, 517),(454, 503),(467, 493),(488, 475),(509, 463),(567, 443),(537, 453),(516, 463),(495, 476),(477, 491),(464, 500),(440, 516),(416, 530),(388, 541),(365, 548),(361, 550),(335, 551),] 686 | self.nose = [(311, 221),(317, 223),(331, 224),(339, 230),(341, 246),(339, 252),(337, 262),(339, 272),(344, 285),(347, 292),(346, 297),(340, 302),(333, 305),(327, 301),(321, 293),(320, 288),(322, 278),(326, 267),(324, 261),(322, 252),(320, 240),(320, 236),(321, 230),(318, 227),(311, 222),] 687 | self.web_lines = [(326, 428),(340, 467),(347, 492),(354, 533),(-1, -1),(390, 520),(386, 499),(378, 464),(-1, -1),(426, 457),(430, 469),(440, 496),(-1, -1),(483, 464),(475, 455),(469, 444),(462, 425),(455, 407),(-1, -1),(300, 436),(310, 432),(327, 433),(-1, -1),(313, 469),(322, 465),(340, 468),(358, 462),(377, 465),(-1, -1),(434, 442),(447, 432),(462, 426),(471, 414),(488, 402),(-1, -1),(510, 430),(494, 437),(482, 448),(476, 455),(464, 460),(453, 464),(446, 470),(434, 482),(419, 486),(409, 487),(401, 490),(387, 500),(377, 498),(369, 498),(349, 504),(341, 503),(335, 503),(325, 503),(-1, -1),(461, 376),(468, 371),(476, 369),] 688 | 689 | 690 | def go(self, x, y): 691 | self.pen.penup() 692 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 693 | self.pen.pendown() 694 | 695 | 696 | def paint(self,coord,co=(0,0,0)): 697 | self.pen.color(co) 698 | t_x,t_y = coord[0] 699 | self.go(t_x,t_y) 700 | self.pen.fillcolor(co) 701 | self.pen.begin_fill() 702 | t = 0 703 | for i in coord[1:]: 704 | #print(i) 705 | x,y = i 706 | if t: 707 | self.go(x,y) 708 | t = 0 709 | self.pen.begin_fill() 710 | continue 711 | if x == -1 and y == -1: 712 | t = 1 713 | self.pen.end_fill() 714 | continue 715 | else: 716 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 717 | self.pen.end_fill() 718 | 719 | 720 | def draw_fn(self,coord,mode = 1,co = (0,0,0),thickness = 1): 721 | co = (co[0]/255,co[1]/255,co[2]/255) 722 | 723 | self.pen.color(co) 724 | 725 | if mode: 726 | self.pen.width(thickness) 727 | t_x,t_y = coord[0] 728 | self.go(t_x,t_y) 729 | t = 0 730 | for i in coord[1:]: 731 | #print(i) 732 | x,y = i 733 | if t: 734 | self.go(x,y) 735 | t = 0 736 | continue 737 | if x == -1 and y == -1: 738 | t = 1 739 | continue 740 | else: 741 | self.pen.goto(x-self.x_offset,(y*-1)+self.y_offset) 742 | else: 743 | self.paint(coord=coord,co = co) 744 | 745 | 746 | def draw(self,retain=True): 747 | self.draw_fn(self.face_out,co = (205, 205, 205),mode = 0) 748 | self.draw_fn(self.face_in,co = (179, 179, 179),mode = 0) 749 | self.draw_fn(self.left_ear,co = (77, 77, 77),mode = 0) 750 | self.draw_fn(self.face_out_2,co = (77, 77, 77),mode = 0) 751 | self.draw_fn(self.face_details,mode = 0) 752 | self.draw_fn(self.nose,co = (204, 204, 204),mode = 0) 753 | self.draw_fn(self.dress_out,co = (201, 0, 15),mode = 0) 754 | self.draw_fn(self.dress_in,co = (230, 30, 36),mode = 0) 755 | self.draw_fn(self.hair,mode = 0) 756 | self.draw_fn(self.extras,mode = 0) 757 | self.draw_fn(self.hair_details,thickness = 1,co = (128, 128, 128),mode = 0) 758 | self.draw_fn(self.web_lines,thickness=5,mode = 1) 759 | self.draw_fn(self.line,mode = 0,co = (198, 0, 15)) 760 | if retain: 761 | self.turt.done() 762 | 763 | 764 | 765 | 766 | 767 | class ironman_ascii: 768 | def __init__(self): 769 | self.data = ['.........................::!**%$$@@@@@@&&@@@@@$$%%*!!:..........................\n', 770 | '....................:!*%$@@&&&&&&&&&&&&&&&&&&&&&&&&&&@@$%!::....................\n', 771 | '.................!*$@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@$*:.................\n', 772 | '..............!%@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$%!..............\n', 773 | '...........:*$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$*:...........\n', 774 | '.........:*@&&&&&&&&&@$%*%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%*%$@&&&&&&&&@%:.........\n', 775 | '........*@&&&&&&&&@$*!!!!!@&&&&&&&&&&&&&&&&&&&&&&&&&&&&*!!!!*%$&&&&&&&@*:.......\n', 776 | '......:$&&&&&&&&$*!!!!!!!!$&&&&&&&&&&&&&&&&&&&&&&&&&&&$!!!!!!!!*%@&&&&&&@!......\n', 777 | '.....!@&&&&&&&$*!!!!!!!!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!!!!!!!!!%@&&&&&&*.....\n', 778 | '....!@&&&&&&$*!!!!!!!!!!!!*@&&&&&&&&&&&&&&&&&&&&&&&&&&*!!!!!!!!!!!!!%@&&&&&%....\n', 779 | '...:@&&&&&@%!!!!!!!!!!!!!!!$&&&&&&&&&&&&&&&&&&&&&&&&&$!!!!!!!!!!!!!!!*@&&&&&*...\n', 780 | '...$&&&&&$*!!!!!!!!!!!!!!!!%&&&&&&&&&&&&&&&&&&&&&&&&&%!!!!!!!!!!!!!!!!!$&&&&&!..\n', 781 | '..!&&&&&$!!!!!!!!!!!!!!!!!!*@&&&&&&&&&&&&&&&&&&&&&&&@*!!!!!!!!!!!!!!!!!!$&&&&$..\n', 782 | '..%&&&&$!!!!!!!!!!!!!!!!!!!!$&&&&&&&&&&&&&&&&&&&&&&&$!!!!!!!!!!!!!!!!!!!!$&&&@:.\n', 783 | '..@&&@*!!!!!!!!!!!!!!!!!!!!!%&&&&&&&&&&&&&&&&&&&&&&&%!!!!!!!!!!!!!!!!!!!!*$&&&:.\n', 784 | '.:@&&@!*!!!!!!!!!!!!!!!!!!!!*&&&&&&&&&&&&&&&&&&&&&&@*!!!!!!!!!!!!!!!!!!!!*$&&&!.\n', 785 | '.!&&&@**!!!!!!!!!!!!!!!!!!!!!@&&&&&&&&&&&&&&&&&&&&&$!!!!!!!!!!!!!!!!!!!!!*$&&&*.\n', 786 | '.*&&&&**!!!!!!!!!!!!!!!!!!!!!%&&&&&&&&&&&&&&&&&&&&&%!!!!!!!!!!!!!!!!!!!!!*@&&&%.\n', 787 | '.$&&&&**!!!!!!!!!!!!!!!!!!!!!*&&&&&&&&&&&&&&&&&&&&@!!!!!!!!!!!!!!!!!!!!!**@&&&$.\n', 788 | ':@&&&&***!!!!!!!!!!!!!!!!!!!!!$&&&&&&&&&&&&&&&&&&@%!!!!!!!!!!!!!!!!!!!!!**@&&&@:\n', 789 | '.$&&&&%!*!!!!!!!!!!!!!!!!!!!!!!********%%*********!!!!!!!!!!!!!!!!!!!!!!**&&&&@.\n', 790 | '!@&&&&%!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**&&&&@!\n', 791 | '@&&&&&$!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!%&&&&&@\n', 792 | '@&&&&&$!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!%&&&&&@\n', 793 | '@&&&&&@!**!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!$&&&&&@\n', 794 | '@&&&&&@!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!$&&&&&@\n', 795 | '@&&&&&@!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**!@&&&&&@\n', 796 | '@&&&&&&*!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!!@&&&&&@\n', 797 | '@&&&&&@!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!!@&&&&&@\n', 798 | '@&&&&&$!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!!%&&&&&@\n', 799 | '$&&&&&*!!*@%*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*$%!!!@&&&&$\n', 800 | '$&&&&@*!!&**S#@%*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*$&S**#!!!$&&&&$\n', 801 | '%&&&&%!*%**##S***#@%*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%$&S****#S*@***&&&&%\n', 802 | '%&&&@*!!#*#%%%$$&#S*SS##&@$$%%**!!!!!!!!!!!!!!!!!!**%%$$@&#S**S#&@$%%$**%!!@&&&*\n', 803 | '*&&&$!!!%S*S&$%%%%%%$@&&#S*****SS##&@@$%%%$@@&&#SSS****SS#&@$%%%%%%$&*S$!!!%&&&*\n', 804 | '!&&&*!!!!*$S**S#&@$$$%%%%%%$$S*********************#$$%%%%%%%%$@@&S**&*!!!!*&&&!\n', 805 | ':@&&$!!!!!!!%&********SSS###S*&$$$$$$$$@@@@@@@$$$&**&&&&##SS******S@*!!!!!!%&&@:\n', 806 | '.!&&&*!!!!!!!!*@&&&##SSSSSSSS&!!!!!!!!!!!!!!!!!!!!@SSSSSSSSS##&&@%*!!!!!!!!@&@!.\n', 807 | '..:&&@!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$&&!..\n', 808 | '...@&&$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%&&@:..\n', 809 | '...$&&&$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%&&&@...\n', 810 | '...%&&&&$*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%&&&&$...\n', 811 | '...%&&&&&$*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%&&&&&%...\n', 812 | '...*&&&&&&$*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*%&&&&&&%...\n', 813 | '...:@&&&&&&$**!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**%&&&&&&&!...\n', 814 | '....%&&&&&&&$!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!%&&&&&&&$....\n', 815 | '....!&&&&&&&&$!**!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!%&&&&&&&&!....\n', 816 | '.....$&&&&&&&&$!**!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**!%&&&&&&&&@.....\n', 817 | '.....!&&&&&&&&&$!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**!%&&&&&&&&&*.....\n', 818 | '......$&&&&&&&&&$!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!!%&&&&&&&&&@:.....\n', 819 | '......*&&&&&&&&&&*!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!!!@&&&&&&&&&*......\n', 820 | '......:@&&&&&&&&&$!!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**!!!%&&&&&&&&&@:......\n', 821 | '.......*&&&&&&&&&&*!!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**!!!!@&&&&&&&&&%.......\n', 822 | '.......:@&&&&&&&&&$!!!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!**!!!!%&&&&&&&&&&:.......\n', 823 | '........%&&&&&&&&&&%!!!!*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*!!!!*&&&&&&&&&&$........\n', 824 | '........:$&&&&&&&&#*@!!!!%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$!!!!%SS&&&&&&&&@:........\n', 825 | '.........:$&&&&&&&*@*#%!$******************************$!*&*&*@&&&&&&$:.........\n', 826 | '..........:%&&&&&$!!%S*&**#$%%%%%%%%%%$%$$$$$$$$$$$$$#**@S*$!!$&&&&&$:..........\n', 827 | '............%&&&&%!!!*&*S$!!!!!!!!!!!!!!!!!!!!!!!!!!!!$S*#*!!!%&&&&$:...........\n', 828 | '.............%&&&&%!!!!%*!!!*!!!!!!!!!!!!!!!!!!!!!!*!!!*%!!!!*@&&&%.............\n', 829 | '..............!@&&&%!!!!!!!!*!!!!!!!!!!!!!!!!!!!!!!*!!!!!!!!%&&&@*..............\n', 830 | '...............:$&&&$!!!!!!!*%********************%*!!!!!!!%&&&$:...............\n', 831 | '.................*&&&$!!**%@@&&&&&&&&&&&&&&&&&&&&&&@$%**!!%&&&%.................\n', 832 | '..................!@&&@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@$$&&@!..................\n', 833 | '...................:%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$:...................\n', 834 | '.....................!$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$!.....................\n', 835 | '.......................!$&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$!.......................\n', 836 | '.........................:*%$@@@&&&&&&&&&&&&&&&&&@@@$*!.........................\n', 837 | '.............................:::!!*%%$@@@@$$%**!!::.............................\n',] 838 | 839 | def draw(self): 840 | #setting the x and y coordinates 841 | s_x = -320 842 | s_y = 250 843 | 844 | p = tu.Pen() 845 | p.speed(0) 846 | tu.bgcolor('black') 847 | p.up() 848 | p.width(2) 849 | f_m = 0 850 | self.d_m = 4 851 | 852 | # function to select the color 853 | def set_col(c): 854 | chars = {"*": 'white', "S" : 'green', "#" : 'green', "&" : 'white', "@":'black', "$" : 'white', "%" : 'white', "!":'blue', ":" :'darkgreen', ".":'grey'} 855 | col = chars[c] 856 | p.pencolor(col) 857 | 858 | def d(m, s_char): 859 | p.up() 860 | if s_char != '\n': 861 | set_col(s_char) 862 | 863 | p.goto(s_x- m, s_y ) 864 | p.down() 865 | p.forward(1) 866 | 867 | for i in self.data: 868 | for j in i: 869 | d(f_m, j) 870 | f_m -= 4 871 | s_y -= 9 872 | s_x = -320 873 | f_m = 0 874 | self.d_m = 4 875 | 876 | tu.done() 877 | 878 | def print_to_terminal(self): 879 | for i in self.data: 880 | print(i,end = '') 881 | 882 | def help(): 883 | print("contribute in github : https://github.com/MRMYSTERY003") 884 | print("youtube : https://www.youtube.com/c/CODEHUB03") 885 | print("contact me personally on instagram : https://www.instagram.com/mr.m_y_s_t_e_r_y/") 886 | print("discuss more about project ideas and join our community on discord : https://discord.gg/r2KFa73PM2") 887 | 888 | 889 | 890 | def get_arts(): 891 | '''get the list of some ready made sketchs''' 892 | print("1.ajp") 893 | print("2.rdj") 894 | print("3.gojo") 895 | print("4.vijay") 896 | print("5.tom_holland") 897 | print("6.flag") 898 | print("7.ironman_ascii") 899 | 900 | 901 | --------------------------------------------------------------------------------