impressionism
Editor's Note: This file was selected as MATLAB Central Pick of the Week
This function "paints" an impressionist like painting of an RGB image.
USAGE
imgOut = impressionism(filename, 'threshold', 50, 'brush sizes', ...
[8 4 2], 'blur factor', 0.5, 'grid spacing', 1, 'brush curvature', ...
1, 'min length', 4, 'max length',16 );
imgOut = impressionism(filename, 'threshold', 50, 'brush sizes', ...
[8 4 2], 'blur factor', 0.5, 'grid spacing', 1, 'brush curvature', ...
1, 'pointillism', 1);
PARAMETERS
'threshold' - determines how closely the painting must approximate
the source image. Higher values of this threshold produce "rougher"
paintings.
default thresh is 50
'brush sizes' - determines the brush sizes used in the painting. Brush
sizes dimensions are pixels and are specified as radii.
default brushSzs = [8 4 2] areas of little detail will be painted with
large brush strokes. Areas with lots of detail will be painted with
little brush strokes
'blur factor'- A smaller blur factor allows more noise in the image,
producing a more "impressionistic" image standard deviation will
be blurFactor * brushSz(k)
default blurFactor = 0.5
'grid spacing' - (grid spacing = gridSpacing*brush radius)
default gridSpacing = 1
'brush curvature' - brushstroke curvature filter constant. Used to limit
or exagerate curvature
default brushCurve = 1
'min length' - minimum stroke length used in painting
default minStrokeLength = 4
'max length' - maximum stroke length used in painting
default maxStrokeLength = 16
'pointillism' - givs a pointillist style painting (sets min and max
length to zero) Note: Do not use 'min length' or 'max length' while
using 'pointillism'
You can use the attached test images. Use the following combinations:
imgOut = impressionism('landscape_test.jpg');
This code was originally inspired by the paper "Painterly Rendering with
Curved Brush Strokes of Multiple Sizes" by Aaron Hertzmann.
Author: David Mills
email: dmills10@jhu.edu
Cite As
David Mills (2024). impressionism (https://www.mathworks.com/matlabcentral/fileexchange/62298-impressionism), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Image Segmentation and Analysis > Region and Image Properties >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
impressionism/
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |