GithubHelp home page GithubHelp logo

noahmeissner / vector-image-drawing-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 56 KB

Small Vector Drawing App, which allows to draw efficient Graphics.

License: MIT License

Python 100.00%
bezier-curves de-casteljau drawing-app floodfill vector-drawing

vector-image-drawing-app's Introduction

Vector Image Drawing App

Easily draw Bézier curves, lines, and polygons using an intuitive user interface. Save and open your work seamlessly, allowing for quick adjustments and refinements.

All functions are custom-implemented, leveraging the power of the NumPy and Tkinter libraries for efficient and interactive graphic creation.

Video_Usage_Drawing.mp4

Implemenation Details

Bresenham's Algorithm:

  • Used to draw lines by setting individual pixels in a straight path between two points with integer coordinates.
  • This algorithm ensures efficient and accurate rendering of lines, avoiding floating-point arithmetic.

De Casteljau's Algorithm:

  • Employed to create segments of Bézier curves, which are used for smooth and scalable curve generation.
  • This recursive algorithm constructs Bézier curves by iteratively subdividing control points.

Flood Fill Algorithm:

  • Applied to fill polygons or areas with a specified color by setting each pixel inside the boundary.
  • This algorithm is commonly used in paint programs and for boundary-defined color filling.

Tkinter for UI Elements:

  • Tkinter is utilized to create and manage various user interface elements such as buttons, labels, and canvases.
  • This Python library allows for the creation of interactive and graphical applications.

Tkinter create_rectangle for Pixel Manipulation:

  • Tkinter's create_rectangle method is used to set pixels individually to draw shapes and lines.
  • Unlike higher-level drawing functions like create_line, create_rectangle can be used to set each pixel's color manually.

NumPy for Pixel Matrices:

  • NumPy is used to store and manipulate pixel matrices efficiently.
  • This library provides a convenient and powerful way to handle large arrays of pixel data for image processing.

Control

  • Left Click: Draw Points
  • Press E: Switch to Edit Mode
  • Press X: Hide Control Points
  • Press C: Refresh Canvas

Usage:

Graphical Interface:

python3 main.py

Installation

pip install tkinter

pip install numpy

vector-image-drawing-app's People

Contributors

noahmeissner avatar

Watchers

 avatar

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.