Readonly idUnique plugin identifier.
Plugin options
ImageFiltersPlugin constructor.
Optional options: ImageFiltersPluginOptionsplugin options
Gets available image filters.
// Create Image Filters plugin:
const imageFiltersPlugin = new ImageFiltersPlugin();
// Remove the default image filters, except for the "Invert" filter:
const filters = imageFiltersPlugin.filters;
for(const filterName in filters) {
if(filterName === "invert")
continue;
delete filters[filterName];
}
// Add custom Image Filter:
filters["lemon-effect"] = {
filterId: "lemon-effect",
toolbarKey: "lemon-effect",
title: "Apply Custom Lemon effect",
text: "Apply Lemon effect",
action: function(imageData) {
for (i = 0; i < imageData.data.length; i += 4) {
imageData.data[i + 1] = imageData.data[i] + 45; // increase green component
}
return imageData;
}
};
// Register Image Filters plugin:
viewer.addPlugin(imageFiltersPlugin);
Returns true if the image is loaded into the viewer and the image format is supported by the Image Filters plugin.
Natural image size.
Checks if the image format specified by the imageFormat parameter is supported.
Optional allowUnknown: boolean
ImageFiltersPlugin class. Adds the "Image Filters" button.
Example
Param