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

colorscore

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colorscore

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Colorscore

Colorscore is a simple library that uses ImageMagick to quantize an image and find its representative colors. It can also score those colors against a palette using the CIE2000 Delta E formula. This could be used to index images for a "search by color" feature.

Requirements

  • ImageMagick 6.5+

Usage

include Colorscore
histogram = Histogram.new('test/fixtures/skydiver.jpg')

# This image is 78.8% #7a9ab5:
histogram.scores.first # => [0.7884625, RGB [#7a9ab5]]

# This image is closest to pure blue:
palette = Palette.from_hex(['ff0000', '00ff00', '0000ff'])
scores = palette.scores(histogram.scores, 1)
scores.first # => [0.16493763694876, RGB [#0000ff]]

FAQs

Package last updated on 06 Jan 2016

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