Fast-SSIM


NameFast-SSIM JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryFast SSIM and PSNR algorithms for Python. Up to 30x speedup for SSIM and up to 10x for PSNR.
upload_time2025-07-17 17:32:26
maintainerNone
docs_urlNone
authorTim Lodemann
requires_python>=3.9
licenseNone
keywords ssim psnr image quality image comparison image processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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/c5/02/c6b7b517e266abaf9bbb3a0b8d0a76fcaedfa24f39bb5f4c30148989ba16/fast_ssim-1.0.1.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.1",
    "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": "0913331afe89c4951b24e7bded78923acff25ff63554ed2c95dce07972693dd2",
                "md5": "01cb1d082d267e7b031a7ea060809cdf",
                "sha256": "102a5eeeb2b29bf6fbd7dd16a2e1ab2f34822d24e3a15c32a2f623fee19eb675"
            },
            "downloads": -1,
            "filename": "fast_ssim-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "01cb1d082d267e7b031a7ea060809cdf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 31652,
            "upload_time": "2025-07-17T17:32:25",
            "upload_time_iso_8601": "2025-07-17T17:32:25.724731Z",
            "url": "https://files.pythonhosted.org/packages/09/13/331afe89c4951b24e7bded78923acff25ff63554ed2c95dce07972693dd2/fast_ssim-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c502c6b7b517e266abaf9bbb3a0b8d0a76fcaedfa24f39bb5f4c30148989ba16",
                "md5": "64b4a2fc196059b319e764750f9aa262",
                "sha256": "8b0b1b7690182ad02c485c539c7da79a7aa01f5079b7aced80aeb62af1187315"
            },
            "downloads": -1,
            "filename": "fast_ssim-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "64b4a2fc196059b319e764750f9aa262",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 32174,
            "upload_time": "2025-07-17T17:32:26",
            "upload_time_iso_8601": "2025-07-17T17:32:26.946113Z",
            "url": "https://files.pythonhosted.org/packages/c5/02/c6b7b517e266abaf9bbb3a0b8d0a76fcaedfa24f39bb5f4c30148989ba16/fast_ssim-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-17 17:32:26",
    "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"
}
        
Elapsed time: 1.00195s