# Cursor clipping mask

**URL:** <https://discourse.processing.org/t/cursor-clipping-mask/24934>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [October 26, 2020, 8:44pm UTC](https://discourse.processing.org/t/cursor-clipping-mask/24934 "2020-10-26T20:44:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pescemc](https://avatars.discourse-cdn.com/v4/letter/p/3be4f8/32.png) [@pescemc](https://discourse.processing.org/u/pescemc)\
**Post date:** [October 26, 2020, 8:44pm UTC](https://discourse.processing.org/t/cursor-clipping-mask/24934/1 "2020-10-26T20:44:51Z")

</div>

Hello, I need to create a program like the one in the video that I leave below, it is about 2 overlapping images, with a clipping mask in a circular shape handled by the mouse, which shows the outside of one image, and inside the other . And I’m not sure if it’s possible to make, thanks!

[https://www.youtube.com/watch?v=RorkBlgz0vQ&feature=youtu.be&ab\_channel=MatiasPesce](https://www.youtube.com/watch?v=RorkBlgz0vQ&feature=youtu.be&ab_channel=MatiasPesce)

At the moment I could insert the 2 images and create the ellipse that the mouse follows, the only thing missing is that the ellipse works as a clipping mask:

```auto
PImage fondo1, fondo2;
PImage mask;

void setup(){
  
  size(1920, 1080);
  
  fondo1 = loadImage("1.jpg");
  fondo2 = loadImage("2.jpg");
  
  frameRate(60);
}

void draw(){
  
  background(fondo2);
  image(fondo1, 0, 0);
  
  ellipse(mouseX, mouseY, 200, 200);
  noStroke();
}

```
