# Why does animating images overlayed with graphics primitives take much longer than animating either individually?

So I start by making a list of images with

 images = Image[ArrayPlot[Import[ (* filenames *) ]]]


Then I run some complicated code that extracts the coordinates of the center of various objects in said images, producing a list of {x,y} coordinates.

Now, if I run

 ListAnimate[images]


it takes about 20 seconds, and running

 ListAnimate[Table[
Show[Graphics[Point[xycoordinates[[i]]], (* plus some other points/lines *)],
{i, 2, Length[xycoordinates]}]]


takes about the same time. However when I run

 ListAnimate[Table[
Show[images[[i]],Graphics[Point[xycoordinates[[i]]], (* plus some other points/lines *)],
{i, 2, Length[xycoordinates]}]]


it takes forever- around 10 minutes.

Why is that? Is there a better way to overlay images with Graphics (or a better way to animate these)?

-
Could you please post a self-contained example so we can replicate your issue? – Verbeia Feb 26 at 10:13
@Verbeia I'll see what I can do. I'd post the exact program but I'm not allowed to make this image data public. I'll try to make an example. – Alexander Gruber Feb 26 at 11:07
When you combine an Image with Graphics using Show, the image is converted to a Raster graphics primitive, which could be the cause of the slow down. I usually use ImageCompose for this sort of thing, which returns an Image rather than a Graphics expression. – Simon Woods Feb 26 at 14:32
i meet the same question. maybe it's because the animate part needs to plot many pictures at the same time so it will be slower. Graphics takes more time, and after using animate, you think it's much slower. – Wjx Feb 27 at 11:47
Would solutions like the ones presented here suit your needs? – J. M. May 4 at 6:26