0.2.0 • Published 4 years ago

image-eyes v0.2.0

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

ImageEyes

ImageEyes offers the genuine colordata of images at your webpage, to serve scientific purposes. Unlike traditional eyedroppers, it buffers the image and reads color value from there without color correction.

Install

Install the package as npm package. Provided are a umd-formatted file in the dist folder to require or just read and an es-module in the module folder to import.

Usage

Get the API thru an async function:

const eyes = await imageEyes(url)

Then you'll be able to have your eyes at pixel-values and metadata:

eyes.getPixelColor(xCoordinate, yCoordinate)
    // => an array with color and alpha channels
eyes.getDropColor(xCoordinate, yCoordinate, sampleSize)
    // => an array with average color and alpha channels
eyes.getColorMode()
    // => a string
eyes.getColorProfile()
    // => a string
eyes.getMetaData({exif|gps|icc|ifd0|iptc|xmp: true})
    // => an object

Demo

Start the demo server with

npm start

todo later

// intelligent caching

resources

https://web.mit.edu/jhawk/mnt/cgs/Image-ExifTool-6.99/html/TagNames/EXIF.html https://web.mit.edu/jhawk/mnt/cgs/Image-ExifTool-6.99/html/TagNames/ICC_Profile.html https://web.mit.edu/jhawk/mnt/cgs/Image-ExifTool-6.99/html/TagNames/Jpeg2000.html https://web.mit.edu/jhawk/mnt/cgs/Image-ExifTool-6.99/html/TagNames/XMP.html https://groups.google.com/forum/#!topic/iiif-discuss/cnx0fxRczKc