p5.js:image
画像、イメージ
画像処理
reference | p5.js
code:sketch.js
let img
// setup()より先に呼び出される
function preload() {
const proxy = 'https://cors-anywhere.herokuapp.com/' //CORSを超えるのに必要
img = loadImage(proxy +'https://i.gyazo.com/de07fbaab5c961dc7fd3720ba956bbd3.png')
}
function setup() {
createCanvas(512, 768)
}
// イメージをキャンバスに描画する
function draw() {
image(img, 0, 0)
}
実行→
CORS を超える必要がある
p5.js:CORS
#p5.js-term
https://img.shields.io/badge/p5.js-image-ED225D.svg?logo=p5.js&style=for-the-badge