Skip to content

This project smoothens the stroke on the HTML Canvas. The earlier strokes appeared to be pixelated which I have smoothen using cubic Bezier curves

Notifications You must be signed in to change notification settings

coderuhaan2004/strokeSmoothening

Folders and files

NameName
Last commit message
Last commit date

Latest commit

10104d9 · Jan 17, 2025

History

9 Commits
Jan 17, 2025
May 25, 2024

Repository files navigation

Stroke Smoothening using bezier curves

Screenshot 2025-01-18 001937 Screenshot 2025-01-18 002000

How to use it

Import all the files in one folder and run HTML file on your browser.

Algorithm used

  1. Keep track of the stroke path by pushing the coordinates of the stroke points in an array.
  2. Simplify the line by Ramer-Douglas-Peckar line simplification method and then push the points of simplified line in new array.
  3. Calculate the control points from the line using bezier curves.
  4. Apply cubic bezier on the line.

About

This project smoothens the stroke on the HTML Canvas. The earlier strokes appeared to be pixelated which I have smoothen using cubic Bezier curves

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages