Advanced enhancement, local contrast, and edge detection
Enhancement is not a single “make it better” switch. Each variant shows the generated output first, followed by the corresponding binding code.
Gaussian blur
Section titled “Gaussian blur”sigma: 2 reduces high-frequency detail. The reference output was generated with govips v2.19.0 / libvips 8.17.3.

Generated with govips v2.19.0 / libvips 8.17.3.
image, err := vips.NewImageFromFile("input.jpg")if err != nil { return err }defer image.Close()if err := image.GaussianBlur(2); err != nil { return err }data, _, err := image.ExportWebp(vips.NewWebpExportParams())if err != nil { return err }return os.WriteFile("blur.webp", data, 0o644)await sharp('input.jpg').blur(2).webp({ quality: 82 }).toFile('blur.webp');image = pyvips.Image.new_from_file("input.jpg")image.gaussblur(2).write_to_file("blur.webp", Q=82)vips gaussblur input.jpg 'blur.webp[Q=82]' 2Sharpen
Section titled “Sharpen”The example uses sigma: 2 and explicit mask parameters. Sharpening can also amplify noise and compression artefacts.

Generated with govips v2.19.0 / libvips 8.17.3.
if err := image.Sharpen(2, 2, 3); err != nil { return err }data, _, err := image.ExportWebp(vips.NewWebpExportParams())if err != nil { return err }return os.WriteFile("sharpen.webp", data, 0o644)await sharp('input.jpg').sharpen({ sigma: 2, m1: 1, m2: 3, x1: 2 }) .webp({ quality: 82 }).toFile('sharpen.webp');image = pyvips.Image.new_from_file("input.jpg")image.sharpen(sigma=2, x1=2, m2=3).write_to_file("sharpen.webp", Q=82)vips sharpen input.jpg 'sharpen.webp[Q=82]' --sigma 2 --x1 2 --m2 3Gamma correction
Section titled “Gamma correction”1.5 is this example’s exponent, not a universal default.

Generated with govips v2.19.0 / libvips 8.17.3.
if err := image.Gamma(1.5); err != nil { return err }data, _, err := image.ExportWebp(vips.NewWebpExportParams())if err != nil { return err }return os.WriteFile("gamma.webp", data, 0o644)await sharp('input.jpg').gamma(1.5).webp({ quality: 82 }).toFile('gamma.webp');image = pyvips.Image.new_from_file("input.jpg")image.gamma(exponent=1.5).write_to_file("gamma.webp", Q=82)vips gamma input.jpg 'gamma.webp[Q=82]' --exponent 1.5Edge detection
Section titled “Edge detection”govips and the CLI use Sobel directly; sharp and pyvips execute the same Sobel kernel with convolve() / conv(). All four outputs were generated, but convolution borders and encoding differences still need comparison in the target use case.

Generated with govips v2.19.0 / libvips 8.17.3.
if err := image.Sobel(); err != nil { return err }data, _, err := image.ExportWebp(vips.NewWebpExportParams())if err != nil { return err }return os.WriteFile("edge.webp", data, 0o644)await sharp('input.jpg').convolve({ width: 3, height: 3, kernel: [-1, 0, 1, -2, 0, 2, -1, 0, 1] }) .webp({ quality: 82 }).toFile('edge.webp');image = pyvips.Image.new_from_file("input.jpg")image.conv([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]).write_to_file("edge.webp", Q=82)vips sobel input.jpg 'edge.webp[Q=82]'sharp-only high-level APIs
Section titled “sharp-only high-level APIs”sharp also exposes normalise(), clahe(), and arbitrary convolve(). Only the actually executed Sobel edge detection has a cross-binding output on this page. normalise() and clahe() have no matching govips v2.19.0 high-level public entry point, so no invented govips implementation is shown. That gap does not mean libvips lacks the operation, and internal vipsGen* functions are not a stable application API.