Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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)?

share|improve this question
2  
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
2  
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

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.