<p align="center">
<h1 align="center">Fast-SSIM</h1>
<p align="center">
Speed up your SSIM and PSNR calculations!
<br />
</p>
</p>
<br>
## ℹ About
This fork wraps the Fast-SSIM project in an easy to use package that can be readily installed via PyPI.
The Fast-SSIM package can accelerate your SSIM and PSNR calculations by up to 30x and 10x respectively.
## Requirements
- Python 3.9 or higher
## How to Install
```
pip install Fast-SSIM
```
## Usage
The functionalities are explained in the following code snippet that is also provided in this repo:
```python
import fast_ssim
from skimage.io import imread
img1_path = r"test_images\0.jpg"
img2_path = r"test_images\1.jpg"
# Load the images into NumPy arrays
img1 = imread(img1_path)
img2 = imread(img2_path)
ssim_score = fast_ssim.ssim(
img1, img2,
data_range=255
)
psnr_score = fast_ssim.psnr(
img1, img2,
data_range=255
)
print(f"SSIM Score: {ssim_score}")
print(f"PSNR Score: {psnr_score}")
```
Output:
```
SSIM Score: 0.9886590838432312
PSNR Score: 31.11587142944336
```
## Notes
- The SSIM calculation uses sample covariance (and sample variance) for its statistics. This aligns with the default behavior of `scikit-image`'s `structural_similarity` function, where `use_sample_covariance` is True by default.
- This implementation does not offer an option for applying a Gaussian filter to the images or local windows prior to the SSIM/PSNR calculation.
## Original author
Chen Yu / [@Chen Yu](https://github.com/chinue)
Raw data
{
"_id": null,
"home_page": null,
"name": "Fast-SSIM",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "ssim, psnr, image quality, image comparison, image processing",
"author": "Tim Lodemann",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/de/50/43ed2f0ffe910bc5e1d90e362920479497e18987baedaf7d8e564fb06a28/fast_ssim-1.0.2.tar.gz",
"platform": null,
"description": "<p align=\"center\">\r\n <h1 align=\"center\">Fast-SSIM</h1>\r\n <p align=\"center\">\r\n Speed up your SSIM and PSNR calculations!\r\n <br />\r\n </p>\r\n</p>\r\n\r\n<br>\r\n\r\n## \u2139 About\r\n\r\nThis fork wraps the Fast-SSIM project in an easy to use package that can be readily installed via PyPI.\r\nThe Fast-SSIM package can accelerate your SSIM and PSNR calculations by up to 30x and 10x respectively.\r\n\r\n## Requirements\r\n\r\n- Python 3.9 or higher\r\n\r\n## How to Install\r\n\r\n```\r\npip install Fast-SSIM\r\n```\r\n\r\n## Usage\r\n\r\nThe functionalities are explained in the following code snippet that is also provided in this repo:\r\n\r\n```python\r\nimport fast_ssim\r\nfrom skimage.io import imread\r\n\r\nimg1_path = r\"test_images\\0.jpg\"\r\nimg2_path = r\"test_images\\1.jpg\"\r\n\r\n# Load the images into NumPy arrays\r\nimg1 = imread(img1_path)\r\nimg2 = imread(img2_path)\r\n\r\nssim_score = fast_ssim.ssim(\r\n img1, img2,\r\n data_range=255\r\n)\r\npsnr_score = fast_ssim.psnr(\r\n img1, img2,\r\n data_range=255\r\n)\r\n\r\nprint(f\"SSIM Score: {ssim_score}\")\r\nprint(f\"PSNR Score: {psnr_score}\")\r\n```\r\n\r\nOutput:\r\n```\r\nSSIM Score: 0.9886590838432312\r\nPSNR Score: 31.11587142944336\r\n```\r\n\r\n## Notes\r\n\r\n- The SSIM calculation uses sample covariance (and sample variance) for its statistics. This aligns with the default behavior of `scikit-image`'s `structural_similarity` function, where `use_sample_covariance` is True by default.\r\n\r\n- This implementation does not offer an option for applying a Gaussian filter to the images or local windows prior to the SSIM/PSNR calculation.\r\n\r\n## Original author\r\n\r\nChen Yu / [@Chen Yu](https://github.com/chinue)\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Fast SSIM and PSNR algorithms for Python. Up to 30x speedup for SSIM and up to 10x for PSNR.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/timminator/Fast-SSIM",
"Issues": "https://github.com/timminator/Fast-SSIM/issues",
"Repository": "https://github.com/timminator/Fast-SSIM.git",
"documentation": "https://github.com/timminator/Fast-SSIM/blob/master/README.md"
},
"split_keywords": [
"ssim",
" psnr",
" image quality",
" image comparison",
" image processing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "461a4bf8f31019e5d9c18a4c3ab7bafb50fb130fe80e29c9d1cd886255896c7e",
"md5": "4cf7bf678404861894f7937a57fb8fc7",
"sha256": "ba924c25356f238ccc94c086c89dce571b81d5b8e2c01a588215b260a7cff3b2"
},
"downloads": -1,
"filename": "fast_ssim-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4cf7bf678404861894f7937a57fb8fc7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 83926,
"upload_time": "2025-07-25T10:22:16",
"upload_time_iso_8601": "2025-07-25T10:22:16.704964Z",
"url": "https://files.pythonhosted.org/packages/46/1a/4bf8f31019e5d9c18a4c3ab7bafb50fb130fe80e29c9d1cd886255896c7e/fast_ssim-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "de5043ed2f0ffe910bc5e1d90e362920479497e18987baedaf7d8e564fb06a28",
"md5": "4ecefa2df2ec35ace7a36efa3c8d157a",
"sha256": "5c61dc04171bcc3763c26c00c2c045b8cc513be7ea8a8092c915f56ff527cd8c"
},
"downloads": -1,
"filename": "fast_ssim-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "4ecefa2df2ec35ace7a36efa3c8d157a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 84519,
"upload_time": "2025-07-25T10:22:19",
"upload_time_iso_8601": "2025-07-25T10:22:19.175238Z",
"url": "https://files.pythonhosted.org/packages/de/50/43ed2f0ffe910bc5e1d90e362920479497e18987baedaf7d8e564fb06a28/fast_ssim-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-25 10:22:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "timminator",
"github_project": "Fast-SSIM",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fast-ssim"
}