- Download paint_app.zip and unpack it.
- Install the required dependencies:
pip install -r requirements.txt
Run the following command to start the application:
python main.py- Brush
- Ability to change brush color. Default brush color is
#00000. - Ability to change brush width
- Brush paints centered dots according to brush color and brush width. In code it's represented by
class Paint - Group of painted dots is a group which contains all painted dots from moment of click on Left Mouse Button until Left Mouse Button release. In code it's represented by
class PaintGroup - Brush is represented in code by
class Brushwhich inheritsclass BasicTool - Eraser
- Ability to change eraser width
- Eraser uses object erasing
- Eraser is represented in code by
class Eraserwhich inheritsclass BasicTool - Figures
class Outlinerepresents the settings of figure outline.class FillFigurerepresents the settings of figure filling.- Ability to draw line. Line is represented in code by
class Linewhich inherits fromclass Outline. - Ability to draw Rectangle, Triangle, Oval, Polygon. Figures are presented in code by
class Figurewhich inherits fromclass Outlineandclass FillFigure. - Ability to change settings such as width and color of figure outline and in addition to
class Figureability to change fill color. - In code figure creating tool is represented by
class FigureDrawing. - Text
- Ability to change font family.
- Ability to change font size.
- Ability to change font color.
- In code text writing tool is represented by
class Texting. - Select
- Select tool let user select object on canvas and then change its settings such as position, layer, color, width and others.
- Topbar adapts to selected object type.
App uses deque or in other words stack to store changes on canvas. Changes are repsented by 4 types: by class of object, by BackgroundChange which tracks canvas background changing, by class DeleteObjectChange which represents performed action to delete object from canvas, by SelectedChange which tracks changes when the object is selected.
SelectedChange stores previous and new copies of object and according to action returns one of them to canvas.
- Canvas has ability to change its color. Default canvas color is
#ffffff. - Ability to save canvas as image in format .jpeg.
- Opportunity to save canvas to .json file and continue to edit the same canvas project later. Canvas project saves by itself when application window is closed by special button with door icon.
User friendly and adaptive GUI is represented by 2 bars: sidebar (class SideBar) and topbar (class TopBar). Both of them inherit from tkinter.Frame and contain custom tkinter.Button buttons that their settings are stored in class BarButton.
Sidebar contains tools buttons and buttons: Undo, Redo, Save as image, Save and close, Clear all, Background color.
Topbar adapts to chosen tool and situation.
All GUI classes are wired up in class ApplicationGUI which inherits from tkinter.Tk.
Constants are placed in file setting.py
Main logic is separated between models and in mostly found in class CanvasManager.