# Rasterize Image/ Flowfield with Noise values from image

**URL:** https://discourse.processing.org/t/rasterize-image-flowfield-with-noise-values-from-image/38176
**Category:** Coding Questions
**Created:** [July 31, 2022, 7:42pm UTC](https://discourse.processing.org/t/rasterize-image-flowfield-with-noise-values-from-image/38176 "2022-07-31T19:42:53Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![asymmetric](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/asymmetric/32/16577_2.png) [@asymmetric](https://discourse.processing.org/u/asymmetric)
#### Post date: [August 1, 2022, 4:16am UTC](https://discourse.processing.org/t/rasterize-image-flowfield-with-noise-values-from-image/38176/4 "2022-08-01T04:16:48Z")

</div>

Thank you @glv! That’s exactly what I am looking for! I tried replacing the sphere(); with line(); and received compiler errors.

```auto
PImage img;

void setup(){
  size(900, 900, P3D);
  img = loadImage("Jan24.jpg");
  img.resize(900,900);
  
}

void draw() {
  background(#f1f1f1);
  fill(0);
  noStroke();
  line(0,0);
  //sphereDetail(3);
  //ellipse(mouseX,mouseY,40,40);
  
  float tiles = 100;
  float tileSize = width/tiles;
  
  push();
  rotateY(radians(frameCount) );
  translate(width/2,height/2);
  
  for (int x = 0; x < tiles; x++) {
    for (int y = 0; y < tiles; y++) {
      
    color c = img.get(int(x*tileSize),int(y*tileSize));
    float b = map(brightness(c),0,255,0,PI); 
    
    float z = map(b,0,1,-100,100);
    
    push();
    translate(x*tileSize - width/2,y*tileSize- height/2, z);
    line(tileSize*b);
    pop();
    
    
    }
    
  }
    
}

```

---

_[View the full topic](https://discourse.processing.org/t/rasterize-image-flowfield-with-noise-values-from-image/38176)._
