Pixmatch

Pixmatch REST API client library for Pixmatch, automated image matching API by Idee. Given an image to look for, it locates identical or modified images within or between large scale image collections.

Using

gem install pixmatch

Example

require 'rubygems'
require 'pixmatch'

Pixmatch.configure do |config|
  config.username     = 'username'
  config.password     = 'password'
  config.url          = 'api.tineye.com'
end

# ping the server
response = Pixmatch.ping()
puts response['status']

# count the number of images in the collection
count = Pixmatch.count()

# add an image
Pixmatch.add('images/mona-lisa.jpg')
Pixmatch.add(File.new('images/mona-lisa.jpg')

# add a collection of images
Pixmatch.add(Dir.glob('images/*.jpg'))

# list images
images = Pixmatch.list()
images.each { |filename| puts filename }

# delete an image
Pixmatch.delete('mona-lisa.jpg')

# delete an array of images
Pixmatch.delete([ 'mona-lisa.jpg', 'mona-lisa-botero.jpg' ])

# search
found = Pixmatch.search('images/mona-lisa.jpg')
found.each { |find|
  puts "#{find['filename']}: #{find['score']}"
}

Contributing

  • Fork the project

  • Copy ‘config/pixmatch.yml.default’ to ‘config/pixmatch.yml’. Edit your pixmatch API credentials as follows.

    test:
      <<: *settings
      username: '<your username>'
      password: '<your password>'
      endpoint: '<your url>.tineye.com'
    
  • Run ‘bundle install’

  • Test with ‘rspec spec’

  • Send pull requests.

Copyright © 2011 Art.sy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.