# \[SOLVED\] Image() nullPtrException

**URL:** <https://discourse.processing.org/t/solved-image-nullptrexception/7424>\
**Category:** Processing.py\
**Created:** [January 11, 2019, 6:12pm UTC](https://discourse.processing.org/t/solved-image-nullptrexception/7424 "2019-01-11T18:12:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [January 11, 2019, 6:53pm UTC](https://discourse.processing.org/t/solved-image-nullptrexception/7424/4 "2019-01-11T18:53:53Z")

</div>

> [@Sky](#):
>
> ```python
> img = loadImage("defect_walk0001.png")
> 
> def setup():
> size(500, 500)
> 
> def draw():
> background(0)
> image(img, 100, 100)
> 
> ```

```python
def setup():
    size(500, 500)
    noLoop()

    global img
    img = loadImage('defect_walk0001.png')

def draw():
    background(0)
    image(img, 100, 100)

```

---

_[View the full topic](https://discourse.processing.org/t/solved-image-nullptrexception/7424)._
