pwlmaciejewski / Imghash
Licence: mit
Perceptual image hashing for Node.js
Stars: ✭ 98
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Imghash
React Tint
A React component that applies image processing filters to an image using Processing
Stars: ✭ 89 (-9.18%)
Mutual labels: image-processing
Dped
Software and pre-trained models for automatic photo quality enhancement using Deep Convolutional Networks
Stars: ✭ 1,315 (+1241.84%)
Mutual labels: image-processing
Pimg
📷 Mini Image Lazy Loader for P(R)eact and Vue
Stars: ✭ 97 (-1.02%)
Mutual labels: image-processing
Replace Color
Replace color with another one pixel by pixel.
Stars: ✭ 90 (-8.16%)
Mutual labels: image-processing
Androidwm
An android image watermark library that supports steganography.
Stars: ✭ 1,322 (+1248.98%)
Mutual labels: image-processing
The bilateral solver
Fast Bilateral Solver implementation with C++ and demos
Stars: ✭ 87 (-11.22%)
Mutual labels: image-processing
Traffic Sign Detection
Traffic signs detection and classification in real time
Stars: ✭ 96 (-2.04%)
Mutual labels: image-processing
Pyautolens
PyAutoLens: Open Source Strong Gravitational Lensing
Stars: ✭ 90 (-8.16%)
Mutual labels: image-processing
Automatic Leaf Infection Identifier
Automatic detection of plant diseases
Stars: ✭ 97 (-1.02%)
Mutual labels: image-processing
Connected Components 3d
Connected components on multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants.
Stars: ✭ 90 (-8.16%)
Mutual labels: image-processing
Retina Features
Project for segmentation of blood vessels, microaneurysm and hardexudates in fundus images.
Stars: ✭ 95 (-3.06%)
Mutual labels: image-processing
Ransac 2d Shape Detection
line, circle and ellipse detection in 2d images.
Stars: ✭ 97 (-1.02%)
Mutual labels: image-processing
Seamcarving
Image processing method that allows to remove an object from a photo.
Stars: ✭ 89 (-9.18%)
Mutual labels: image-processing
Forensic
Copy-move image forgery detection library.
Stars: ✭ 94 (-4.08%)
Mutual labels: image-processing
Sign Language Recognition
✌️ 👌 ✊ 📷 Sign Language Recognition using Python
Stars: ✭ 98 (+0%)
Mutual labels: image-processing
Photostructure For Servers
PhotoStructure for Servers
Stars: ✭ 98 (+0%)
Mutual labels: image-processing
Augmentor.jl
A fast image augmentation library in Julia for machine learning.
Stars: ✭ 95 (-3.06%)
Mutual labels: image-processing
imghash
Promise-based image perceptual hash calculation for node.
Installation
npm install imghash
ℹ️ You can find the command-line interface here.
Basic usage
const imghash = require('imghash');
imghash
.hash('path/to/file')
.then((hash) => {
console.log(hash); // 'f884c4d8d1193c07'
});
// Custom hex length and result in binary
imghash
.hash('path/to/file', 4, 'binary')
.then((hash) => {
console.log(hash); // '1000100010000010'
});
Finding similar images
To measure similarity between images you can use Hamming distance or Levenshtein Distance.
The following example uses the latter one:
const imghash = require('imghash');
const leven = require('leven');
const hash1 = imghash.hash('./img1');
const hash2 = imghash.hash('./img2');
Promise
.all([hash1, hash2])
.then((results) => {
const dist = leven(results[0], results[1]);
console.log(`Distance between images is: ${dist}`);
if (dist <= 12) {
console.log('Images are similar');
} else {
console.log('Images are NOT similar');
}
});
API
.hash(filepath[, bits][, format])
Returns: ES6 Promise
, resolved returns hash string in specified format and length (eg. f884c4d8d1193c07
)
Parameters:
-
filepath
- path to the image (supported formats arepng
andjpeg
) orBuffer
-
bits
(optional) - hash length [default:8
] -
format
(optional) - output format [default:hex
]
.hashRaw(data, bits)
Returns: hex hash
Parameters:
-
data
- image data descriptor in form{ width: [width], height: [height], data: [decoded image pixels] }
-
bits
- hash length
.hexToBinary(s)
Returns: hex string, eg. f884c4d8d1193c07
.
Parameters:
-
s
- binary hash string eg.1000100010000010
.binaryToHex(s)
Returns: hex string, eg. 1000100010000010
.
Parameters:
-
s
- hex hash string eg.f884c4d8d1193c07
Further reading
imghash
takes advantage of block mean value based hashing method:
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].