GPU Debayer
Updated:
Fastvideo GPU Debayer converts a raw Bayer image from a camera or DSLR into a full-color RGB image on the NVIDIA GPU with four high-quality demosaicing algorithms — HQLI, L7, DFPD, and MG. The highest-quality MG algorithm reaches about 40.5 dB average PSNR on the Kodak data set, and on an NVIDIA GeForce RTX 4090 the algorithms run at up to 69 GPix/s (65 MPix, 16-bit) — far faster than any CPU implementation. It doubles as a testing tool: it measures the processing time of each method and computes PSNR/MSE against reference images, so demosaicing quality and speed can be compared before building a heavier image processing service. To embed the same algorithms into your own pipeline, the functionality is also available as the CUDA Debayer Library.
Detailed benchmark data. Measured results are published on our benchmark pages: Debayer benchmarks, all benchmarks.
Need the developer component or the algorithm background? Integrate the CUDA Debayer Library into your own pipeline, or see how the demosaicing algorithms (HQLI, L7, DFPD, MG) work. This page is the ready GPU debayer software.
- Converts 8/16-bit raw bayer image from camera or DSLR to 24/48-bit RGB
- Can do that very fast on NVIDIA GPU, much faster than on any CPU
- High quality debayer methods
- Immediate time measurements for each method
- Makes comparison with etalon images and calculates PSNR/MSE
Trusted by imaging teams
“Fastvideo SDK is lightning fast… we can now process a 28,800 image sequence set in under 10 minutes, instead of 10 hours.”
What's unique in GPU Debayer software
- Among the fastest GPU debayer implementations available
- Sophisticated debayer algorithms with high PSNR / SSIM and low artifacts
- Simple to use, fast to work and easy to check
- Testing tool to check quality, timing and performance of debayer algorithms prior to developing heavy loaded services for image processing
- Developed by a team with years of CUDA and GPU imaging experience
GPU Debayer Software Features
Which demosaicing algorithms does GPU Debayer support?
- All Bayer patterns for input data supported (RGGB, BGGR, GBRG, GRBG)
- Mosaic algorithm to prepare bayer image from any 24/48-bit PPM
- Read 8/16-bit input bayer raw image from camera, DSLR or from HDD/SSD/RAID in PGM format
- Output format: 24/48-bit PPM
- Min image resolution 128 × 128 pixels
- Debayer quality for the following algorithms:
- HQLI debayer (High Quality Linear Interpolation, window 5×5) – avr. PSNR ~ 36 dB (SSIM ~ 0.965) for Kodak data set
- L7 debayer (High Quality Linear Interpolation, window 7×7) – avr. PSNR ~ 37.1 dB (SSIM ~ 0.971) for Kodak data set
- DFPD debayer (Directional Filtering and a Posteriori Decision, window 11×11) – avr. PSNR ~ 39 dB (SSIM ~ 0.978) for Kodak data set
- MG debayer (Multiple Gradients, window 23×23) – avr. PSNR ~ 40.5 dB for Kodak data set
- Peak performance (GPU computations only, for 65 MPix resolution, 16-bit image, no batch, no streaming) on NVIDIA GeForce RTX 4090:
- HQLI debayer – up to 69 GPix/s
- L7 debayer – up to 62 GPix/s
- DFPD debayer – up to 48 GPix/s
- MG debayer – up to 20 GPix/s
- Quality measurements: MSE and PSNR
- Timing and performance measurements for each algorithm
- Command-line demo application for Windows-10/11 and Linux Ubuntu, L4T
- NVIDIA Jetson: Nano, Xavier NX/AGX, Orin NX/AGX
| Demosaicing algorithm | Window | Avg PSNR (Kodak) | SSIM | Peak speed on RTX 4090* |
| HQLI | 5×5 | ~36 dB | ~0.965 | up to 69 GPix/s |
| L7 | 7×7 | ~37.1 dB | ~0.971 | up to 62 GPix/s |
| DFPD | 11×11 | ~39 dB | ~0.978 | up to 48 GPix/s |
| MG (highest quality) | 23×23 | ~40.5 dB | — | up to 20 GPix/s |
* GPU computations only, 65 MPix 16-bit image, no batch, no streaming.
What else is interesting in Fastvideo GPU Debayer
Fastvideo GPU Debayer is a CUDA library of high-quality demosaicing algorithms — HQLI, L7, DFPD, and MG — that convert 8/16-bit Bayer data to RGB on NVIDIA GPUs. The higher-quality MG algorithm reaches about 40.5 dB average PSNR on the Kodak data set, and all four run fast enough for real-time camera pipelines as well as quality-critical offline processing.
- We can offer high performance debayer library for your specific needs, particularly for high speed batch debayers
- We are also offering custom software design for combined debayer and JPEG compression on NVIDIA GPUs
- We have designed fast image processing SDK on GPU for high speed and high resolution cameras: dark frame subtraction, flat-field correction, white balance, demosaicing, denoising, color correction, tone mapping, image filtering, rotating, cropping, resizing, sharpening, OpenGL rendering and output, jpeg/jpeg2000/bayer/h264/h265/av1 encoding, CUDA FFmpeg integration, streaming, etc.
- The above GPU debayers are constituent parts of FastVCR software for machine vision cameras
GPU Debayer FAQ
What is the difference between debayer and demosaicing?
They are two names for the same operation — converting raw Bayer/CFA sensor data into a full RGB image. “Debayer” is the applied, camera-side term; “demosaicing” (or demosaicking) is the academic one. See the demosaicing algorithms page for the theory behind GPU Debayer.
Which demosaicing algorithm gives the best image quality?
MG (Multiple Gradients, 23×23 window) is the highest-quality algorithm, at about 40.5 dB average PSNR on the Kodak data set. HQLI, L7, and DFPD trade some quality for higher speed, so the right choice depends on whether the pipeline is quality-critical or throughput-critical.
How fast is GPU debayering?
On an NVIDIA GeForce RTX 4090, peak throughput ranges from up to 69 GPix/s for HQLI down to 20 GPix/s for the highest-quality MG (65 MPix 16-bit image, GPU computation only) — far faster than any CPU debayer.
Which Bayer patterns and bit depths are supported?
All four Bayer patterns are supported (RGGB, BGGR, GBRG, GRBG). Input is an 8/16-bit raw Bayer image from a camera, DSLR, or PGM file; output is a 24/48-bit RGB image.
Does GPU Debayer run on NVIDIA Jetson?
Yes. It runs on the NVIDIA Jetson line — Nano, Xavier NX/AGX, and Orin NX/AGX — under Linux4Tegra, as well as on desktop NVIDIA GPUs under Windows and Linux.
What is the difference between GPU Debayer and the CUDA Debayer Library?
GPU Debayer is a ready-to-run demo and testing tool: it times each method and computes PSNR/MSE against reference images. The CUDA Debayer Library embeds the same algorithms into your own GPU pipeline.
How is demosaicing quality measured?
Quality is reported as average PSNR (and SSIM) against reference images on the standard Kodak data set. The application computes MSE and PSNR directly, so you can verify quality on your own images. These are not the best possible metrics, but they look approprite.
Can I test it on my own images and hardware?
Yes. The command-line demo for Windows 10/11 and Linux Ubuntu / L4T reads 8/16-bit Bayer images in PGM format from disk, so no camera is required, and it reports timing and quality for every algorithm on your own GPU.
GPU Debayer Roadmap
GPU Debayer is a mature, production module of the Fastvideo SDK, under active development. Recent work delivered the high-quality MG algorithm (about 40.5 dB average PSNR on Kodak), its integration into FastVCR, and optimizations for the Ampere and Ada GPU architectures.
Current development focuses on:
- MG2 — a new high-performance demosaicing algorithm with improved image quality

