Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > opencv-comfyui > OpenCV PSNR_0

ComfyUI Node: OpenCV PSNR_0

Class Name

PSNR_0

Category
image/OpenCV
Author
geroldmeisinger (Account age: 1432days)
Extension
opencv-comfyui
Latest Updated
2026-07-22
Github Stars
0.04K

How to Install opencv-comfyui

Install this extension via the ComfyUI Manager by searching for opencv-comfyui
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter opencv-comfyui in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

OpenCV PSNR_0 Description

Calculates PSNR between two images using OpenCV to assess image quality and signal fidelity.

OpenCV PSNR_0:

The PSNR_0 node is designed to calculate the Peak Signal-to-Noise Ratio (PSNR) between two images, which is a widely used metric for assessing the quality of reconstructed or compressed images. PSNR is expressed in decibels and provides a measure of the peak error between the original and a processed image. A higher PSNR value generally indicates that the processed image is of higher quality and closer to the original. This node leverages the OpenCV library's PSNR function to perform the calculation, making it a reliable choice for image quality assessment tasks. By using this node, you can easily compare two images and quantify the difference in terms of signal fidelity, which is particularly useful in image processing applications where maintaining image quality is crucial.

OpenCV PSNR_0 Input Parameters:

src1

src1 is the first input image represented as a NumPy array. This parameter serves as the reference image against which the second image will be compared. The quality of the second image is evaluated based on how closely it matches this reference image.

src2

src2 is the second input image, also represented as a NumPy array. This is the image whose quality is being assessed. The PSNR value will indicate how similar this image is to the reference image (src1).

R

R is a floating-point value representing the maximum possible pixel value of the images. For example, for 8-bit images, this value is typically 255. This parameter is crucial as it defines the dynamic range of the pixel values, which directly affects the PSNR calculation.

OpenCV PSNR_0 Output Parameters:

float

The output is a single floating-point value representing the PSNR between the two input images. This value is expressed in decibels (dB) and provides a quantitative measure of the image quality. A higher PSNR value indicates better quality, meaning the second image is more similar to the reference image.

OpenCV PSNR_0 Usage Tips:

  • Ensure that both input images (src1 and src2) are of the same size and type to avoid errors during the PSNR calculation.
  • Use an appropriate value for R based on the bit depth of your images to ensure accurate PSNR results.
  • Consider using PSNR in conjunction with other image quality metrics for a more comprehensive assessment of image quality.

OpenCV PSNR_0 Common Errors and Solutions:

Mismatched image dimensions

  • Explanation: This error occurs when the input images src1 and src2 have different dimensions.
  • Solution: Ensure that both images have the same width, height, and number of channels before passing them to the node.

Invalid pixel value range

  • Explanation: This error arises when the R value does not match the actual pixel value range of the images.
  • Solution: Verify that the R value corresponds to the maximum possible pixel value for your image format (e.g., 255 for 8-bit images).

Unsupported image type

  • Explanation: This error occurs if the input images are not in a supported format or type.
  • Solution: Convert the images to a compatible format, such as a NumPy array with a standard data type, before using the node.

OpenCV PSNR_0 Related Nodes

Go back to the extension to check out more related nodes.
opencv-comfyui
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

OpenCV PSNR_0