# Get() Problems - Pro3 - Fr/Eng

**URL:** <https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245>\
**Category:** Coding Questions\
**Created:** [November 6, 2020, 9:02pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245 "2020-11-06T21:02:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eli0kYd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/eli0kyd/32/11221_2.png) [@Eli0kYd](https://discourse.processing.org/u/Eli0kYd)\
**Post date:** [November 6, 2020, 9:02pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245/1 "2020-11-06T21:02:04Z")

</div>

Hello ! I’m new to processing and I need your help 🙂

I need to select pixel’s area from my original image and to transpose it in rectangles.  
I learned that -get()( could help me but I do not know where to place it in my code :

PImage photo;  
int posX = int(random(0,1920));  
int posY = int(random(0,1080));  
int sizeH = int(random(0,400));  
int sizeL = int(random(0,400));

void setup() {  
size(1000,600);  
photo = loadImage(“Photo.jpg”);

}  
void draw(){  
background(0,0,0);  
image(photo,0,0,1920,1080);

}

* * *

The source for -get()- : [https://www.processing.org/reference/get\_.html](https://www.processing.org/reference/get_.html)

thanksyou !!

---

<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:** [November 6, 2020, 10:04pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245/2 "2020-11-06T22:04:28Z")

</div>

Hello and welcome to the forum!

Nice to have you here!

Yeah, you can select an area and copy it to a new image

`PImage pi = get(30,30,100,100);`

then you can make a nested for-loop over pi and use `col1=get(x,y);` to get the color of one color pixel

Then you can use `fill(col1); rect(....);` to enlarge pi. Just multiply x,y to get a grid of bigger rectangles.

Warm regards,

Chrisir

---

<div class="post-metadata">

**Author:** ![Eli0kYd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/eli0kyd/32/11221_2.png) [@Eli0kYd](https://discourse.processing.org/u/Eli0kYd)\
**Post date:** [November 6, 2020, 10:07pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245/3 "2020-11-06T22:07:47Z")

</div>

OOoh thanks you so much ! 🙂

Can I enlarge pi with random number ?

Warm regards,

Elio

---

<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:** [November 6, 2020, 10:54pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245/4 "2020-11-06T22:54:16Z")

</div>

> [@Eli0kYd](#):
>
> Can I enlarge pi with random number ?

of course

`PImage pi = get(30,30,random(40,200),random(40,200));`

see [get() / Reference / Processing.org](https://www.processing.org/reference/get_.html)

---

<div class="post-metadata">

**Author:** ![Eli0kYd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/eli0kyd/32/11221_2.png) [@Eli0kYd](https://discourse.processing.org/u/Eli0kYd)\
**Post date:** [November 7, 2020, 12:14pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245/5 "2020-11-07T12:14:10Z")

</div>

OK well, Thank you very much 🙂
