this post was submitted on 17 May 2025
64 points (98.5% liked)

Fediverse

33609 readers
105 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration)

founded 2 years ago
MODERATORS
 

cross-posted from: https://piefed.social/post/761023

PieFed uses PDQ hashing to generate a fingerprint of an image and can use that fingerprint to detect other posts that use the same or fairly similar images, for moderation purposes. Hashes are added to a block list which stops the image from being re-posted in future. Demo

PieFed does not generate PDQ hashes itself - it uses a separate service to do it. Several different instances could be using the same hashing service which will be more efficient than everyone running their own. When an image is being federated around the URL of it will be sent to the hashing service by multiple different fedi instances and only the first will be slow as all the subsequent requests will be served from a cache.

Get the code from https://github.com/rimu/pdqhash-python

By doing a GET request for https://yourdomain.tld/pdq-hash?image_url=url_to_image_to_hash you will receive JSON like this:

{ 
    "pdq_hash_binary": "100100100011...",  
    "quality": 100  
}  

The quality score (0โ€“100) indicates how well the image content supports a reliable perceptual hash.

Higher scores mean better contrast, edges, and texture in the image. PieFed accepts anything > 70.

top 1 comments
sorted by: hot top controversial new old
[โ€“] asudox@lemmy.asudox.dev 3 points 5 days ago* (last edited 5 days ago)

Is this similar to blurhash?

~~I'm certain you can achieve this with blurhash as well, and also get the benefits of blurhash.~~

edit: nope, definitely not. Blurhashes are pretty small compared to PDQ hashes, it seems.