This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Implements libpuzzle for python.

It is designed to quickly find visually similar images (GIF, PNG, JPG), even if they have been resized, recompressed, recolored or slightly modified.

Sample applications:

  • finding duplicate images in photo libraries
  • image classification
  • image search services
  • moderation (pictures sent by users on forums, wikis, blogs, etc). Pictures similar to other pictures that were previously banned can be signaled to moderators.

The library relies on the GD Library in order to load bitmap pictures.

On a debian server, installation would be:

$ apt -y install libpuzzle-dev libgd2-xpm-dev
$ pip install libpuzzle

Usage:

from libpuzzle import Puzzle, SIMILARITY_THRESHOLD

puzzle = Puzzle()
sign1 = puzzle.from_filename('img1.jpg')
sign2 = puzzle.from_filename('img2.png')
distance = sign1.distance(sign2)
if distance <= SIMILARITY_THRESHOLD:
    print('images are propably the same')

API:

SIMILARITY_THRESHOLD
SIMILARITY_HIGH_THRESHOLD
SIMILARITY_LOW_THRESHOLD
SIMILARITY_LOWER_THRESHOLD

class Puzzle:

    max_width  #

    max_height  #

    lambdas  #

    noise_cutoff  #

    p_ratio  #

    contrast_barrier_for_cropping  #

    max_cropping_ratio  #

    autocrop  #

    from_filename(filename) -> Signature
        # hydrate Signature from filename

    from_signature(sign) -> Signature
        # hydrate Signature from value

    from_compressed_signature(sign) -> Signature
        # hydrate Signature from compressed value


class Signature:
    # Implements signature

    value  # the value
    compressed  # the compressed value

    distance(signature) -> float
        # distance between 2 signatures


exception PuzzleError:
    # Raise when something went wrong
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0rc5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0rc4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0rc3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0rc2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0rc1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
libpuzzle-1.0.0.tar.gz (44.4 kB) Copy SHA256 Checksum SHA256 Source Feb 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting