# Does anybody have tips with smooth moving?

**URL:** https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456
**Category:** Coding Questions
**Created:** [November 13, 2019, 11:18am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456 "2019-11-13T11:18:49Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 13, 2019, 11:18am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/1 "2019-11-13T11:18:49Z")

</div>

Hi, I’m back with my second question:)  
I am currently making a zooming effect, by gradually increasing the size of an image.  
It does work well, but it kind of lags and the pixels get all mixed up; **I don’t want to slow it down** , and the smooth() function doesn’t seem like the one I’m looking for.  
Does anybody have a tip about smooth moving? I’d really appreciate it.🙂

---

<div class="post-metadata">

### Author: ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)
#### Post date: [November 13, 2019, 11:22am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/2 "2019-11-13T11:22:54Z")

</div>

It seems that your Code just runs slowly. The best Option would probably be to try and make your code more efficient, or to save the zooming as Images and just show it as a video/displaying the individual images one after the other a time.

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 13, 2019, 11:28am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/3 "2019-11-13T11:28:20Z")

</div>

Got it. So there aren’t any functions or something that helps making smoother graphics or something?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 13, 2019, 11:30am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/4 "2019-11-13T11:30:18Z")

</div>

> [@24stevek](#):
>
> **slow it down** , and the smooth() function doesn’t seem like the one I’m looking for.

better post your code , but use the

```auto
</> code button from editor menu

```

to paste into

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 13, 2019, 11:32am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/5 "2019-11-13T11:32:18Z")

</div>

Sorry I just think I should just slow the code down  
Thank you though:)

---

<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: [November 22, 2019, 4:51pm UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/6 "2019-11-22T16:51:26Z")

</div>

If you are using the five-argument form of image – `image(img, a, b, c, d)` – in draw(), then you are resizing your image every frame, and that can get really slow.

There are many potential workarounds, including pre-scaling to different sizes, or using a 3D space and drawing at different depths to zoom. However, good advice on optimizing performance depends on knowing the specific details of your code.

---

<div class="post-metadata">

### Author: ![24stevek](https://avatars.discourse-cdn.com/v4/letter/2/edb3f5/32.png) [@24stevek](https://discourse.processing.org/u/24stevek)
#### Post date: [November 23, 2019, 3:02am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/7 "2019-11-23T03:02:43Z")

</div>

Ok. Maybe I should just study Processing a little more.

---

<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: [November 23, 2019, 4:57am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456/8 "2019-11-23T04:57:53Z")

</div>

Sure. Some of these things – like 5-arg image being slow - we learn through experience. Keep in mind that, if you share an MCVE, people can give you optimization advice. If you don’t, we are just guessing blindly.
