# Resize background image

**URL:** <https://discourse.processing.org/t/resize-background-image/20883>\
**Category:** Coding Questions\
**Created:** [May 14, 2020, 7:38pm UTC](https://discourse.processing.org/t/resize-background-image/20883 "2020-05-14T19:38:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanjoc](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@juanjoc](https://discourse.processing.org/u/juanjoc)\
**Post date:** [May 14, 2020, 7:38pm UTC](https://discourse.processing.org/t/resize-background-image/20883/1 "2020-05-14T19:38:12Z")

</div>

Hi everyone,  
I have created an image (1920 x 1080 px) for my background. When I open the the file in another laptop that has a lower window size, then I get problems running the file. I wonder if there is a way to resize the background image.

```auto
PImage background;
void setup()
{
     size(displayWidth, displayHeight);
     background = loadImage("fondo.png");
     image(background,0,0,displayWidth, displayHeight);
}
void draw()
{
}

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 16, 2020, 11:21pm UTC](https://discourse.processing.org/t/resize-background-image/20883/2 "2020-05-16T23:21:48Z")

</div>

> then I get problems running the file

Problems how? Looks the wrong dimensions, low resolution, black edges? Sketch crashes? Something else?

```auto
void setup()
{
     size(displayWidth, displayHeight);

```

Use `settings()` for this. Do you want to `fullscreen()`?

> **[settings() / Reference](https://processing.org/reference/settings_.html)**
>
> The settings() function is new with Processing 3.0. It's not needed in most sketches. It's only useful when it's absolutely necessary to define the parameters to size() with a variable. …

> **[fullScreen() / Reference](https://processing.org/reference/fullScreen_.html)**
>
> This function is new for Processing 3.0. It opens a sketch using the full size of the computer's display. This function must be the first line in setup(). The size() and fullScreen()\<…

If you are trying to display a fullscreen sketch with a background image on screens with different aspect ratios then you need to decide what should happen – should it stretch, or constrain aspect ratios to width, height, longest, or shortest dimension?
