# How to parallelize animations

**URL:** https://discourse.julialang.org/t/how-to-parallelize-animations/95461
**Category:** Performance
**Created:** [March 2, 2023, 6:23pm UTC](https://discourse.julialang.org/t/how-to-parallelize-animations/95461 "2023-03-02T18:23:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)
#### Post date: [March 2, 2023, 6:23pm UTC](https://discourse.julialang.org/t/how-to-parallelize-animations/95461/1 "2023-03-02T18:23:40Z")

</div>

I have been using the `@animate` macro in the `Plots.jl` package. I have noticed that the animation is always built using one thread. So for example, in the following toy example :

```julia
N=1000;
anim = @animate for t in 1:N
        x = [0;cos(n)]; y = [0;sin(n)];
        plt = plot( x, y )
    end
    gif( anim, "t.gif", fps=10);

```

The animation is created one frame at a time and put together. I have checked that it used only processor although 36 are available.

```julia
julia> Threads.nthreads()
36

```

Is it possible to parallelize this ? For example, if there are 4 threads, one could parallely compute the frames for n in the ranges 1:250, 251:500, 501:750 and 751:1000, and finally append them end to end.
