Skip to content

raviolliii/PaintBrush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaintBrush

Applies a customizable, modern flat water color type effect on images (I'm not quite sure how to describe it just yet).

Current Usage

NOTE: As of right now, it only works on jpg images and will output png images. I wanted to use this as a learning experience more than anything else, which is why I didn't use any existing packages too extensively, and processing images (especially larger ones) take some time.

Still a WIP but if you want to test it out on images, the quickest way is to use main.py, which takes command line arguments to test. Part of the project is built in cython, so you'll have to build the file for your machine first (maybe you don't need to, I'm stil figuring out the whole cython thing - also the build file is not included in git yet).

Build the cython file

python3 setup.py build_ext --inplace to build the cython code

Use the main.py file

The effect is created with a two part process

  1. Group pixels similar in color together
    1. An alpha value (float) determines how much colors can vary to be considered "similar". 0 will not blend any colors together while something like 70 will blend together colors that are way different
  2. Smooth out the jagged edges
    1. A radius value (int) determines how smoothed out the edges are

python3 main.py <input_img_path> <output_img_path> <alpha> <radius>

Ex. python3 main.py assets/weeknd.jpg assets/weeknd_results.png 36 7

(creates the resulting image above)

About

Adds a modern, water color color effect to images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages