Giter Site home page Giter Site logo

mrmystery003 / sketchpy Goto Github PK

View Code? Open in Web Editor NEW
72.0 2.0 37.0 690 KB

Do you want to draw some cool pictures with a few lines of Python code? SketchPy is here to help..Sketchpy is a Python module for animating drawings of images. The sketchpy module is created on top of the turtle module in Python.

Home Page: https://codehub03.blogspot.com/

License: MIT License

Python 100.00%
sketchpy python drawing turtel graphics animation rdj how-to-draw-with-python sketchpy-python animation-library

sketchpy's Issues

Methods for saving the sketch as svg ,png or jpg

No offense, The project is very nice,creative and fun but I'm thinking about exporting the art to the local storage. A method for saving the art to a desired format and path.It'd be fun to have a save_as function.
Thanks

error with svg files

this is my code:

from sketchpy import canvas

if __name__ == '__main__':
    pen = canvas.sketch_from_svg("2022_04_06.svg")
    pen.draw()

this is the output in console:

python.exe main.py
loading data
100%|██████████| 25/25 [00:09<00:00,  2.60it/s]
svg data loaded
42 40

but I see this small window and it no draw anithing:

image

this is the file that I have used:

2022_04_06

I have generated it with this site: https://svgconvert.com/#/

Drawing from raw image

Thanks for the fun package! The current sample code provided for the drawing from raw image is as below - should the last line be obj.draw(threshold=270) instead?

    from sketchpy import canvas
    obj = canvas.sketch_from_image('IMAGE PATH')
    obj = draw(threshold = 127)

How can I align my image in center of the canvas?

I am using sketchpy. I tried to draw some image which I converted into SVG format. After running the code, the turtle starts drawing from such a location which does not result in aligning the image at the center of the canvas. Is there any method to do this?

KeyError: 'USERPROFILE'

My code:

from sketchpy import library as lib

Error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
[<ipython-input-3-504f6cc831a4>](https://localhost:8080/#) in <cell line: 1>()
----> 1 from sketchpy import library as lib

1 frames
[/usr/local/lib/python3.10/dist-packages/sketchpy/library.py](https://localhost:8080/#) in <module>
    226 
    227 path = os.path.join(
--> 228     os.environ["USERPROFILE"], "AppData", "Local", "Programs", "Python", "data.txt")
    229 def log(mode, data = ''):
    230     try:

[/usr/lib/python3.10/os.py](https://localhost:8080/#) in __getitem__(self, key)
    678         except KeyError:
    679             # raise KeyError with the original key value
--> 680             raise KeyError(key) from None
    681         return self.decodevalue(value)
    682 

KeyError: 'USERPROFILE'

Not Working

"Import "sketchpy" could not be resolvedPylance[reportMissingImports]" This i error is poping up while i try to run it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.