{"id":21682053,"url":"https://github.com/erfannamira/pixel-harmony","last_synced_at":"2026-05-21T14:07:14.031Z","repository":{"id":223145551,"uuid":"759427007","full_name":"ErfanNamira/Pixel-Harmony","owner":"ErfanNamira","description":"A Python script for comparing image quality using SSIM, PSNR, and other metrics. 🖼️","archived":false,"fork":false,"pushed_at":"2024-02-19T05:09:36.000Z","size":43,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T10:51:53.213Z","etag":null,"topics":["image-analysis","image-comparison","image-processing","opencv","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErfanNamira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-18T15:11:46.000Z","updated_at":"2025-02-07T12:23:03.000Z","dependencies_parsed_at":"2024-11-25T15:47:46.893Z","dependency_job_id":null,"html_url":"https://github.com/ErfanNamira/Pixel-Harmony","commit_stats":null,"previous_names":["erfannamira/pixel-harmony"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ErfanNamira/Pixel-Harmony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErfanNamira%2FPixel-Harmony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErfanNamira%2FPixel-Harmony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErfanNamira%2FPixel-Harmony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErfanNamira%2FPixel-Harmony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErfanNamira","download_url":"https://codeload.github.com/ErfanNamira/Pixel-Harmony/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErfanNamira%2FPixel-Harmony/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33303170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"ssl_error","status_checked_at":"2026-05-21T12:22:11.673Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-analysis","image-comparison","image-processing","opencv","python"],"created_at":"2024-11-25T15:32:56.867Z","updated_at":"2026-05-21T14:07:14.003Z","avatar_url":"https://github.com/ErfanNamira.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pixel Harmony 🖼️\nPixel Harmony is a Python script designed to analyze and compare the quality of two images using various metrics. It provides insights into the similarity and quality difference between the images by utilizing metrics such as SSIM, PSNR, Absolute Error, Mean Absolute Error, Normalized Cross-Correlation, Root Mean Squared Error, and Histogram Comparison.\n\n## Metrics Overview\n### Structural Similarity Index (SSIM) 📊\nThe Structural Similarity Index (SSIM) is a metric used to quantify the similarity between two images. It takes into account not only the global luminance (brightness) differences but also the local structural information (textures, edges) present in the images. SSIM produces a value between -1 and 1, where:\n\n1 indicates perfect similarity between the images.\n\n0 indicates no similarity between the images.\n\n-1 indicates perfect dissimilarity between the images.\n\n### Peak Signal-to-Noise Ratio (PSNR) 🔊\nThe Peak Signal-to-Noise Ratio (PSNR) is a metric commonly used to measure the quality difference between an original image and a compressed or distorted version of that image. It measures the ratio between the maximum possible power of a signal and the power of the noise that affects the fidelity of its representation. PSNR is expressed in decibels (dB), and a higher PSNR value indicates better image quality.\n\nIn essence, SSIM and PSNR complement each other in assessing image quality, with SSIM focusing on structural similarity and PSNR focusing on the amount of noise or distortion in the image.\n\n### Absolute Error (AE) and Mean Absolute Error (MAE) 📉\nAbsolute Error (AE) measures the absolute difference between the pixel values of corresponding pixels in two images. It provides insight into the magnitude of the difference between the images at a pixel level. Mean Absolute Error (MAE) is the average of these absolute differences across all pixels, providing a single scalar value to quantify the overall difference between the images.\n\n### Normalized Cross-Correlation (NCC) 🔄\nNormalized Cross-Correlation (NCC) measures the similarity between two images by computing the normalized correlation coefficient between their pixel intensities. It evaluates the pattern correlation between the images, with higher scores indicating greater correlation and similarity.\n\n### Root Mean Squared Error (RMSE) 📏\nRoot Mean Squared Error (RMSE) calculates the root mean squared difference between the pixel values of corresponding pixels in two images. It provides a measure of the average magnitude of the differences between the images, with lower values indicating higher similarity.\n\n### Histogram Comparison 📊\nHistogram Comparison calculates the correlation between the histograms of two images. It quantifies how similar the distributions of pixel intensities are between the images, with higher correlation values indicating greater similarity in pixel intensity distributions.\n\n## Installation 💻\nYou can install the required libraries using pip:\n```\npip install opencv-python scikit-image\n```\nTo use Pixel Harmony, you can either download the PixelHarmony.py file from the releases page or directly from the raw file of PixelHarmony.py in the repository.\n## Usage 🚀\nSave the two images you want to compare in the same directory as the script. (1.jpg \u0026 2.jpg)\n\nRun the script by executing python PixelHarmony.py in the command line.\n\nThe script will calculate and display the SSIM and PSNR scores, along with additional metrics, for the provided images.\n\n## Example Output 📝\n```\nSSIM Score: 0.9606657154431885\nDescription: The images are very similar, with minor differences.\n\nPSNR Score: 37.84524003455975 dB\nDescription: The images have moderate quality, with some loss of information.\n\nAbsolute Error:\n[[ 2.,  1.,  1., ...,  6.,  2.,  1.],\n  [ 5.,  5.,  5., ...,  3.,  5.,  7.],\n  [ 0.,  1.,  2., ...,  1., 12.,  2.],\n  ...,\n  [ 2.,  2.,  2., ...,  3.,  1.,  2.],\n  [ 2.,  2.,  2., ...,  5.,  3.,  0.],\n  [ 2.,  2.,  2., ...,  3.,  1.,  3.]]\n\nMean Absolute Error: 2.4401609757078506\nNormalized Cross-Correlation: 0.9995338916778564\nRoot Mean Squared Error: 3.293665264711223\nHistogram Comparison: 0.9994742033940714\n```\n## Contributions 🤝\nContributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfannamira%2Fpixel-harmony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferfannamira%2Fpixel-harmony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfannamira%2Fpixel-harmony/lists"}