{"action":"opened","issue":{"url":"https://api.github.com/repos/processing/p5.js-website/issues/191","labels_url":"https://api.github.com/repos/processing/p5.js-website/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/processing/p5.js-website/issues/191/comments","events_url":"https://api.github.com/repos/processing/p5.js-website/issues/191/events","html_url":"https://github.com/processing/p5.js-website/issues/191","id":115824196,"number":191,"title":"use graphic as mask. why does this not work?","user":{"login":"soundreactor","id":4352735,"avatar_url":"https://avatars.githubusercontent.com/u/4352735?v=3","gravatar_id":"","url":"https://api.github.com/users/soundreactor","html_url":"https://github.com/soundreactor","followers_url":"https://api.github.com/users/soundreactor/followers","following_url":"https://api.github.com/users/soundreactor/following{/other_user}","gists_url":"https://api.github.com/users/soundreactor/gists{/gist_id}","starred_url":"https://api.github.com/users/soundreactor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soundreactor/subscriptions","organizations_url":"https://api.github.com/users/soundreactor/orgs","repos_url":"https://api.github.com/users/soundreactor/repos","events_url":"https://api.github.com/users/soundreactor/events{/privacy}","received_events_url":"https://api.github.com/users/soundreactor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-09T07:47:18Z","updated_at":"2015-11-09T07:47:18Z","closed_at":null,"body":"i edited the masking example\r\nhttp://p5js.org/examples/examples/Image_Alpha_Mask.php\r\n\r\nusing a graphic as mask does not work like expected\r\nwhy so? and is there a fix for that?\r\n\r\nvar img;\r\nvar imgMask;\r\nvar pg;\r\n\r\nfunction preload() {\r\n  img = loadImage(\"assets/moonwalk.jpg\");\r\n  imgMask = loadImage(\"assets/mask.png\");\r\n}\r\nfunction setup() {\r\n  createCanvas(720, 400);\r\n  pg = createGraphics(720, 400);\r\n  pg.background(0);\r\n  pg.noStroke();\r\n  pg.fill(255);\r\n  pg.ellipse(300, 200, 50, 50);\r\n  img.mask(pg);\r\n}\r\nfunction draw(){\r\n  background(0, 102, 153);\r\n  //this should work but does not\r\n  image(img, 0,0);\r\n} "}}