image_filter_sharpen

The 'image_filter_sharpen' directive applies a sharpening filter to images served by NGINX.

Syntaximage_filter_sharpen amount;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The 'image_filter_sharpen' directive is used within the NGINX HTTP server to apply a sharpen effect to images being processed by the image filter module. This directive can enhance the appearance of images by increasing contrast in edges and fine details. It takes a single parameter that specifies the sharpening amount, which controls how much the filter enhances the sharpness of the image. The higher the value, the sharper the image becomes, but excessive sharpening may lead to artifacts.

When configured properly, the 'image_filter_sharpen' directive can be placed within different contexts such as http, server, and location blocks. The directive should be used in conjunction with the image filter module which processes image files that NGINX serves. If the image is not being processed or if the filter module is not enabled, this directive will have no effect. The effectiveness of the sharpening can vary based on the original quality of the image as well.

It's important for users to provide numeric values (typically ranging from 0 to 100) to fine-tune the amount of sharpening effect applied to the image. Setting the value appropriately according to the needs of the visual output can offer significant enhancements to image clarity while maintaining a natural appearance, avoiding over-sharpening.

Config Example

location /images {
    image_filter brighten 0.1;
    image_filter_sharpen 10;
}

Ensure the image filter module is included in your NGINX build, or this directive will not work.

Using excessive sharpening values can result in unnatural-looking images and visible artifacts.

The directive only works for images processed through the image filter; static images served without processing will not be affected.

← Back to all directives