Writing Plugins
There are two types of plugins you can write for Jimp:
- Image format plugins
- Image manipulation plugins
You can combine plugins to create a Custom Jimp.
Image format plugins
Image format plugins are responsible for loading and saving images in a specific format.
For example, the bmp package is responsible for loading and saving BMP images.
An image format plugins is composed of two functions: encode
and decode
.
Image manipulation plugins
Image manipulation plugins are responsible for manipulating images.
For example, the blur package is responsible for applying a blur effect to an image.
An image manipulation method takes an image as its first argument, does something to it, and returns a new image.
Generally our method APIs follow the following pattern:
- They can take 1 primitive as an option (other than
image
) - Otherwise they take and options object defined and validated by
zod
.