(p5.Image.obj).blend

def setup
  fruit = loadImage("fruit.png")
  wall = loadImage("wall.png")

  fruit.blend(wall, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST)
  image(fruit, 0, 0)
  image(wall, 0, 0)
end
def setup
  fruit = loadImage("fruit.png")
  wall = loadImage("wall.png")

  fruit.blend(wall, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST)
  image(fruit, 0, 0)
  image(wall, 0, 0)
end
def setup
  fruit = loadImage("fruit.png")
  wall = loadImage("wall.png")

  fruit.blend(wall, 0, 0, 33, 100, 67, 0, 33, 100, ADD)
  image(fruit, 0, 0)
  image(wall, 0, 0)
end

p5.jsリファレンス(参考情報)

[p5.js] (p5.Image.obj).blend

概要

イメージの指定領域をイメージの別の領域にブレンドモードを適用してコピーします。

書式

blend(srcImage, sx, sy, sw, sh, dx, dy, dw, dh, blendMode)
blend(sx, sy, sw, sh, dx, dy, dw, dh, blendMode)

引数

引数名内容備考オプションデフォルト値
srcImagep5.Imageオブジェクト
sxコピー元の領域の左上 x座標コピー元
syコピー元の領域の左上 y座標
swコピー元の領域の幅
shコピー元の領域の高さ
dxコピー先の領域の左上 x座標コピー先
dyコピー先の領域の左上 y座標
dwコピー先の領域の幅
dhコピー先の領域の高さ
blendModeブレンドモード BLEND
DARKEST
LIGHTEST
DIFFERENCE
MULTIPLY
EXCLUSION
SCREEN
REPLACE
OVERLAY
HARD_LIGHT
SOFT_LIGHT
DODGE
BURN
ADD
NORMAL

戻値

なし

備考

関連

blend