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)?
ImagewithGraphicsusingShow, the image is converted to aRastergraphics primitive, which could be the cause of the slow down. I usually useImageComposefor this sort of thing, which returns anImagerather than aGraphicsexpression. – Simon Woods Feb 26 at 14:32