Published
Edited
Jan 7, 2022
3 stars
Also listed in…
image/colour manipulation
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ctx1 = floydSteinberg.getContext("2d")
Insert cell
ctx2 = atkinson.getContext("2d")
Insert cell
data = {
let img = await FileAttachment("cage_cropped.jpg").image();
let ctx = DOM.canvas(img.width, img.height).getContext('2d');
ctx.drawImage(img, 0, 0);
return {
data: ctx.getImageData(0, 0, img.width, img.height),
width: img.width,
height: img.height
};
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more