ruby-libgd

GD::Image#filter

Applies a pixel-level filter to the image.

Signature

filter(type, *args)

Supported filters

negate

img.filter("negate")

Inverts image colors.

grayscale

img.filter("grayscale")

Converts the image to grayscale.

brightness

img.filter("brightness", value)

contrast

img.filter("contrast", value)

colorize

img.filter("colorize", r, g, b, a)

Applies a color overlay.

sepia

img.filter("sepia")

Applies a sepia tone. Implemented in ruby-libgd.

Notes

The underlying implementation maps to libgd filters where available; sepia is provided by ruby-libgd.