Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imghash-rs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imghash-rs

Image hashing powered by Rust!

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

Image Hashing powered by Rust

This package is a thin wrapper that contains Python bindings for the Rust crate imghash-rs that allows you to generate various image hashes. the following hashes are supported:

  • Average Hash
  • Difference Hash
  • Perceptual Hash

If you want to know more about the different hashes or how they get encoded / decoded, check the documentation of imghash-rs.

Getting Started

To get started add the package to your project:

pip install imghash-rs

Then you can use it by importing the different functions:

from imghash import average_hash, difference_hash, perceptual_hash

ahash = average_hash("path/to/image")

print(ahash.hex()) # will return the hash encoded as string
print(ahash.bits()) # will return a 2D list of bools that are the encoded bits

To learn more about the underlying bit matrix that gets generated, check this document.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc