No description, website, or topics provided.
Latest commit 91c1469 Dec 7, 2015 Petar Petrov updated README
Failed to load latest commit information.
src small fix Dec 7, 2015
.gitignore initial code commit Oct 29, 2015
.jshintrc initial code commit Oct 29, 2015
Gulpfile.js initial code commit Oct 29, 2015
LICENSE Added Apache license Nov 3, 2015


An OpenSeadragon plugin to allow reading the rgb values of image pixels.



This plugin requires the latest version of OpenSeadragon

Include dist/openseadragonrgb.js after OpenSeadragon in your html. Then after you create a viewer:

var rgbPlugin = viewer.rgb(options);


    onCanvasHover: function(color) {},

Get values

You can get the RGBA value at an arbitrary point using viewport coordinates like this:

var color = rgbPlugin.getValueAt(x, y);

Then color (wheter from getValueAt() or passed to the onCanvasHover callback) will contain:

    r: Number, // value for Red channel
    g: Number, // value for Green channel
    b: Number, // value for Blue channel
    a: Number, // value for Alpha channel
    image: OpenSeadragon.TiledImage // image that contains this pixel if there is any


If your tiles come from a different domain, you may get this error in the console:

Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.

The only way to fix this is to make the tile server return the Access-Control-Allow-Origin: * header and pass the crossOriginPolicy: 'Anonymous' option to OpenSeadragon. For more info on this go to