Lab / Zybo FPGA filter playground
Zybo FPGA filter playground
What each filter does
- Sepia
- Mixes the red, green and blue channels to give the image a warm brown tint.
- RGB inversion
- Subtracts each colour channel from 255, turning each colour into its complement.
- Inverted greyscale
- Converts the image to greyscale, then swaps light and dark.
- Half brightness
- Halves each colour channel to darken the image.
- Double brightness
- Doubles each colour channel and caps it at 255 so highlights saturate.
- 3×3 Gaussian blur
- Softens fine detail by averaging a greyscale pixel with its neighbours, giving more weight to nearby pixels.
- 3×3 box blur
- Smooths the image by giving all nine greyscale pixels in the window equal weight.
- Adjustable sharpening
- Adds a scaled difference between each greyscale pixel and its four direct neighbours to bring out detail.
- Laplacian edge detection
- Compares each greyscale pixel with its eight neighbours and displays the strength of the response in either direction.
- Seven-band rainbow tint
- Uses each pixel’s greyscale brightness to tint it with one of seven colours, chosen by its horizontal position.
About the video samples
The moving test pattern highlights changes in colour and fine detail. The other two clips animate photographs with camera movement. Waterfall and rocks is based on a photograph by Paul Jarvis. Glass towers is based on a photograph by Anthony DELANOIX.
From Verilog to the browser
I wrote these filters in Verilog for a Zybo Z7-20 coursework project. This playground applies the intended filter math in the browser. It uses a true 3×3 neighbourhood for spatial filters, repeats the nearest pixel at the image border, and clamps output to 8 bits. The coursework Verilog uses different buffering and arithmetic, and its committed Vivado reports show timing violations.