Sharpen an image

Increase local edge contrast with a 3×3 convolution while preserving image dimensions.

freeworks offlinenothing uploaded
ToolSharpen Filter
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

A 3×3 kernel gives the centre weight 1 + 4a and four neighbours −a, with diagonal weights zero. Coordinates outside the image clamp to the nearest edge before RGB channels are accumulated.

  • Amount 1 is the initial high-pass strength.
  • Alpha is copied from the centre pixel.

Worked example

Sharpen a test tile
Input
											Input: data:image/png;base64,iVBORw0KGgo=
Amount: 1
										
Output
												PNG data URL with edge-enhanced RGB pixels
											

When to use this

Scanned documents increase crispness, photo pipelines sharpen before export, and graphics lessons demonstrate convolution kernels.

Edge cases

  • Strong amounts create halos and clipped highlights.
  • Edge pixels reuse border samples rather than wrapping.
  • Noise is high-frequency detail and can be amplified.

References