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_1

ComfyUI Node: OpenCV PSNR_1

Class Name

PSNR_1

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_1 Description

PSNR_1 calculates the PSNR between two images using OpenCV to assess image quality in dB.

OpenCV PSNR_1:

The PSNR_1 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. This node leverages the OpenCV library to perform the PSNR calculation, providing a quantitative measure of the difference between two images. The PSNR value is expressed in decibels (dB), where a higher value indicates better quality, meaning the images are more similar. This node is particularly useful in image processing tasks where you need to evaluate the effectiveness of image compression algorithms or compare the quality of different image processing techniques. By using PSNR_1, you can objectively assess image quality, which is crucial for tasks that require high fidelity in image reproduction.

OpenCV PSNR_1 Input Parameters:

src1

src1 is the first input image represented as a NumPy array. This image serves as the reference or original image against which the second image will be compared. The quality of this image is assumed to be the baseline for the PSNR calculation.

src2

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

R

R is a floating-point value representing the maximum possible pixel value of the images. For example, if the images are 8-bit, R would typically be 255. This parameter is crucial as it normalizes the PSNR calculation, ensuring that the metric is consistent across different image formats and bit depths.

OpenCV PSNR_1 Output Parameters:

float

The output parameter float is a single floating-point value representing the PSNR between the two input images. This value is expressed in decibels (dB) and provides a measure of the similarity between the images. A higher PSNR value indicates that the images are more similar, with values above 30 dB generally considered to indicate good quality.

OpenCV PSNR_1 Usage Tips:

  • Ensure that both input images (src1 and src2) are of the same dimensions and data 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. For 8-bit images, R should be 255, while for 16-bit images, it should be 65535. - PSNR is most effective when comparing images of the same scene or content. Ensure that the images you are comparing are intended to be similar in content for meaningful results.

OpenCV PSNR_1 Common Errors and Solutions:

Mismatched image dimensions

  • Explanation: The input images src1 and src2 must have the same dimensions for the PSNR calculation to be valid.
  • Solution: Ensure that both images are resized or cropped to the same dimensions before using the PSNR_1 node.

Invalid R value

  • Explanation: The R parameter must correspond to the maximum possible pixel value for the image format being used.
  • Solution: Verify the bit depth of your images and set R accordingly (e.g., 255 for 8-bit images, 65535 for 16-bit images).

Non-numeric input

  • Explanation: The input images must be numeric arrays (NumPy arrays) for the PSNR calculation to work.
  • Solution: Convert any non-numeric image data to a NumPy array format before inputting it into the PSNR_1 node.

OpenCV PSNR_1 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.