This example shows how to represent a GeoTIFF raster directly into a Canvas object.
The example is identical to this one, but with another way to create the color scales. This method makes easy to create all the complex color scales needed, and it's taken from the plotty library.
The color scale used here is taken from the colorbrewer2 site, with the name RdBu.
Modified http://d3js.org/topojson.v1.min.js to a secure url
https://d3js.org/d3.v4.min.js
https://d3js.org/topojson.v1.min.js
https://d3js.org/d3-scale-chromatic.v1.min.js