# Load image and get pixel value

**URL:** <https://openrndr.discourse.group/t/load-image-and-get-pixel-value/42>\
**Category:** Beginners\
**Created:** [January 6, 2020, 1:44am UTC](https://openrndr.discourse.group/t/load-image-and-get-pixel-value/42 "2020-01-06T01:44:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://openrndr.discourse.group/u/Yann)\
**Post date:** [January 6, 2020, 1:44am UTC](https://openrndr.discourse.group/t/load-image-and-get-pixel-value/42/1 "2020-01-06T01:44:04Z")

</div>

After loading an image, how do I access the pixel color at some coordinate?  
For example, it is easy in processing: [Reference / Processing.org](https://processing.org/reference/get_.html)

I was not able to find this in the guide ([Images - OPENRNDR GUIDE](https://guide.openrndr.org/drawingBasics/images.html#loading-and-drawing-images))  
thanks.

---

<div class="post-metadata">

**Author:** ![ricardo](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/ricardo/32/8_2.png) [@ricardo](https://openrndr.discourse.group/u/ricardo)\
**Post date:** [January 7, 2020, 5:33pm UTC](https://openrndr.discourse.group/t/load-image-and-get-pixel-value/42/2 "2020-01-07T17:33:50Z")

</div>

Here’s an example on how to do it:

```
val image = loadImage("data/images/pm5544.png")
val shadow = image.shadow

shadow.download() // this is how you get hold of the pixel values

extend {
    for (x in 0 until 76) {
        for (y in 0 until 57) {
            drawer.stroke = null
            drawer.fill = shadow[((x / 76.0) * image.effectiveWidth).roundToInt(), ((y / 57.0) * image.effectiveHeight).roundToInt()]
            drawer.rectangle(x * 10.0, y * 10.0, 10.0, 10.0)
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://openrndr.discourse.group/u/Yann)\
**Post date:** [January 8, 2020, 3:28pm UTC](https://openrndr.discourse.group/t/load-image-and-get-pixel-value/42/3 "2020-01-08T15:28:21Z")

</div>

Thank you, the shadow was what I needed.
