# Is there a convenient way to access individual pixels of an image?

**URL:** <https://openrndr.discourse.group/t/is-there-a-convenient-way-to-access-individual-pixels-of-an-image/465>\
**Category:** Beginners\
**Created:** [December 3, 2022, 3:08pm UTC](https://openrndr.discourse.group/t/is-there-a-convenient-way-to-access-individual-pixels-of-an-image/465 "2022-12-03T15:08:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dl33](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dl33](https://openrndr.discourse.group/u/dl33)\
**Post date:** [December 3, 2022, 3:08pm UTC](https://openrndr.discourse.group/t/is-there-a-convenient-way-to-access-individual-pixels-of-an-image/465/1 "2022-12-03T15:08:30Z")

</div>

I’d like to manipulate pixels one by one in some manner. I hate writing in low-level languages like GLSL though, especially with no autocompletion and error highlighting. So I don’t care about performance now, I just want to access pixels of an image like `img[y][x]` or smth similar.

However, on my own I only found how to use ByteBuffers with images loaded as ColorBuffers, which is doable but **very** far from a concise and simple syntax. Is there an alternative?

---

<div class="post-metadata">

**Author:** ![Alessandro](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/alessandro/32/412_2.png) [@Alessandro](https://openrndr.discourse.group/u/Alessandro)\
**Post date:** [December 3, 2022, 3:40pm UTC](https://openrndr.discourse.group/t/is-there-a-convenient-way-to-access-individual-pixels-of-an-image/465/2 "2022-12-03T15:40:43Z")

</div>

Hi there,  
when I have the need to manipulate pixels in a color buffer I use the shadow attribute. Here’s little example where I fill a color buffer with Perlin noise

```kotlin
 val noise = colorBuffer(width, height)
        val shadow = noise.shadow
        shadow.download()
        for (x in 0 until width){
            for (y in 0 until height){
                    shadow[x, y] = ColorRGBa.WHITE.opacify(perlin2D(10, x * 0.01, y * 0.01) * 0.5 + 0.5)
            }
        }
        shadow.upload()

```

I don’t know if this is what you are looking for, but maybe it’s a starting point.

---

<div class="post-metadata">

**Author:** ![dl33](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dl33](https://openrndr.discourse.group/u/dl33)\
**Post date:** [December 3, 2022, 7:29pm UTC](https://openrndr.discourse.group/t/is-there-a-convenient-way-to-access-individual-pixels-of-an-image/465/3 "2022-12-03T19:29:03Z")

</div>

Oh, turns out I’m not able to read a single [article](https://guide.openrndr.org/advancedDrawing/colorbuffers.html#color-buffer-shadows) to the end. Welp, thanks, this looks like exactly what I wanted!
