Git Product home page Git Product logo

drawbot's Introduction

DrawBot

DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics. The built-in graphics primitives support rectangles, ovals, (bezier) paths, polygons, text objects, colors, transparency and much more. You can program multi-page documents and stop-motion animations. Export formats include PDF, SVG, PNG, JPEG, TIFF, animated GIF and MP4 video.

To download the latest version of the app, go to
http://www.drawbot.com/content/download.html


Using DrawBot as a Python module

DrawBot can also be installed as a Python module, the app is not required.

Install

download: https://github.com/typemytype/drawbot/archive/master.zip

run cd <path/where/you/have/downloaded/and/unzipped/drawBot> run python setup.py install

Usage

    import drawBot

    drawBot.newDrawing()
    drawBot.newPage(1000, 1000)
    drawBot.rect(10, 10, 100, 100)
    drawBot.saveImage("~/Desktop/aRect.png")
    drawBot.endDrawing()

It is adviced to start with newDrawing() and end with endDrawing(), to clear the instruction stack and remove installed fonts.


Compile DrawBot from source

compile drawBot.app (with UI)

Required packages:

(Most of these are available through pip.)

Compile:

DrawBot is compiled with py2app into an application package.

cd path/To/drawBot
python setupApp.py py2app

compile drawBot Python module only

This module only works on Mac OS as it requires PyObjC, AppKit, CoreText Quartz and more.

Required packages:

Compile:

cd path/To/drawBot
python setup.py install

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.