# Image Processing With Pixels error

**URL:** <https://discourse.processing.org/t/image-processing-with-pixels-error/27030>\
**Category:** Beginners\
**Created:** [January 13, 2021, 4:04pm UTC](https://discourse.processing.org/t/image-processing-with-pixels-error/27030 "2021-01-13T16:04:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ELaN](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ELaN](https://discourse.processing.org/u/ELaN)\
**Post date:** [January 13, 2021, 4:04pm UTC](https://discourse.processing.org/t/image-processing-with-pixels-error/27030/1 "2021-01-13T16:04:42Z")

</div>

I’ve written this cose:

\<void setup(){  
size(337,450);  
frog=loadImage(“frog.jpg”);  
}

void draw(){  
image(frog,0,0);

loadPixels();  
frog.loadPixels();  
for(int x=0; x\<width; x++){  
for(int y=0; y\<height; y++){  
int loc=x+y\*width;  
pixels[loc]=frog.pixels[loc];  
}  
}  
updatePixels();  
}\>

And I get the following error:  
“frog cannot be resolved to a variable”.

I should also add that I have saved the image with correct name frog.jpg in the sketch file.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 13, 2021, 4:07pm UTC](https://discourse.processing.org/t/image-processing-with-pixels-error/27030/2 "2021-01-13T16:07:54Z")

</div>

> [@ELaN](#):
>
> frog

say PImage frog; before setup()

like you say int loc you need to declare frog as a variable with a type.

Chrisir

---

<div class="post-metadata">

**Author:** ![ELaN](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@ELaN](https://discourse.processing.org/u/ELaN)\
**Post date:** [January 13, 2021, 4:24pm UTC](https://discourse.processing.org/t/image-processing-with-pixels-error/27030/3 "2021-01-13T16:24:31Z")

</div>

You’re right my mind got a little stuck there. Thank you!
