# Resize image processing crash

**URL:** https://discourse.processing.org/t/resize-image-processing-crash/39223
**Category:** Libraries
**Created:** [October 12, 2022, 6:38am UTC](https://discourse.processing.org/t/resize-image-processing-crash/39223 "2022-10-12T06:38:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gradientquestion](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gradientquestion](https://discourse.processing.org/u/gradientquestion)
#### Post date: [October 12, 2022, 6:38am UTC](https://discourse.processing.org/t/resize-image-processing-crash/39223/1 "2022-10-12T06:38:17Z")

</div>

Hello !

does anyone know why on my code my image is not in the original format? I try to apply Resize but it does not work on my image? how can i resize it? it looks like she puts herself in a square

I just want my image to be at the original size, to appear in the center when there is sound

Thank you for your help !!

```auto

import [processing.video](https://processing.video/).*;

import processing.sound.*;

AudioIn micro;

Amplitude amp;

Movie movie;

PImage logo;

void setup() {

fullScreen ();

movie = new Movie(this, "gradient_low.mov");

movie.loop();

micro = new AudioIn(this, 0);

micro.start();

amp = new Amplitude(this);

amp.input(micro);

logo = loadImage("logoo.png");

[//logo.resize](https://logo.resize/)(590, 275);

}

void draw() {

//image(movie, 0, 0);

[//logo.resize](https://logo.resize/)(width, height);

//image(logo,width/2, height/2, amp.analyze() * 2550, amp.analyze() * 2550);

imageMode(CORNER);

image(movie,0,0);

imageMode(CENTER);

[//logo.resize](https://logo.resize/)(590, 275);

image(logo,width/2, height/2, amp.analyze() * 2550, amp.analyze() * 2550);

[//logo.resize](https://logo.resize/)(int(amp.analyze()) * 2550, 1004);

//image(logo,width/2, height/2);

//image(logo,width/2, height/2, amp.analyze() * 2550, amp.analyze() * 2550);

}

void movieEvent(Movie m) {

[m.read](https://m.read/)();

}

```

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [October 12, 2022, 8:41am UTC](https://discourse.processing.org/t/resize-image-processing-crash/39223/2 "2022-10-12T08:41:31Z")

</div>

There is a lot going on in your sketch so first create a simple sketch that loads the logo image, resizes the image in setup and then displays it in draw.

If that works start adding things back in one at a time. Start with the video then the sound. If it didn’t work then perhaps the image file is corrupted.

Removing complexity will help track down the actual problem.

---

<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: [October 12, 2022, 3:54pm UTC](https://discourse.processing.org/t/resize-image-processing-crash/39223/3 "2022-10-12T15:54:08Z")

</div>

> [@gradientquestion](#):
>
> ```auto
> image(logo,width/2, height/2, amp.analyze() * 2550, amp.analyze() * 2550);
> 
> ```

Do you mean this line?

image() with 5 parameters is always slower  
than with 3.

Try with 3 parameters

Try resize in setup and not in draw() for testing
