# Get() and images

**URL:** <https://discourse.processing.org/t/get-and-images/15092>\
**Category:** Coding Questions\
**Created:** [October 31, 2019, 10:51pm UTC](https://discourse.processing.org/t/get-and-images/15092 "2019-10-31T22:51:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SheCurvesMobius](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shecurvesmobius/32/7054_2.png) [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Post date:** [October 31, 2019, 10:51pm UTC](https://discourse.processing.org/t/get-and-images/15092/1 "2019-10-31T22:51:24Z")

</div>

Hi all,

With the following sketch, the image is drawn at (140, 500). However, when I sample the image using the get() function, it acts as though the image is drawn at (0, 0). How do I correct this?

Thanks!

```auto
let colours;

function setup() {
	colours = loadImage('colours.jpg');
	createCanvas(700, 700);
	background(0);
}

function draw() {
	image(colours, 140, 500, 190, 110);

	fill(colours.get(mouseX, mouseY));
	noStroke();
	ellipse(50, 50, 50, 50);
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 31, 2019, 10:54pm UTC](https://discourse.processing.org/t/get-and-images/15092/2 "2019-10-31T22:54:27Z")

</div>

with

```auto
colours.get();

```

read from the image,  
with

```auto
get();

```

from the canvas,  
difference is, that is where you actually placed the image.

---

<div class="post-metadata">

**Author:** ![SheCurvesMobius](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shecurvesmobius/32/7054_2.png) [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Post date:** [October 31, 2019, 11:13pm UTC](https://discourse.processing.org/t/get-and-images/15092/3 "2019-10-31T23:13:29Z")

</div>

Amazing! Thank you so much 🙂
