Skip to content

Filters

Scrimage comes with a wide array of filters. A filter modifies the pixels of an image in some pre-determined way. For example, a simple filter might reduce the brightness of each pixel by 50%.

Most of these filters I have not written myself, but rather collected from other open source imaging libraries (for compliance with licenses and / or attribution - see file headers), and either wrapped them, fixed bugs or improved them.

!!! note These filters require the scrimage-filters module to be added to your build.

Applying a filter returns a new image. The original image is unmodified. Some filters have options which can be set when creating the filters. All filters are immutable. Most filters have sensible default options as default parameters.

To apply a filter, we just use the filter method on an image, for example:

ImmutableImage filtered = image.filter(new DitherFilter())
val filtered = image.filter(DitherFilter())
val filtered = image.composite(new DitherFilter())

Click on the small images to see an enlarged example.

Filter Example 1 Example 2 Example 3
black_threshold
blur
border
brightness
bump
caption
chrome
color_halftone
colorize
contour
contrast
crystallize
despeckle
diffuse
dither
edge
emboss
error_diffusion_halftone
gain_bias
gamma
gaussian
glow
gotham
grayscale
hsb
invert_alpha
invert
kaleidoscope
lensblur
lensflare
minimum
maximum
motionblur
nashville
noise
offset
oil
old_photo
opacity
pixelate
pointillize_square
posterize
prewitt
quantize
rays
rgb
ripple
roberts
rylanders
sepia
sharpen
smear_circles
snow
sobels
solarize
sparkle
summer
swim
television
threshold
tritone
twirl
unsharp
vignette
vintage
watermark_cover
watermark_stamp