1
$\begingroup$

I recently created a key frame animation using Mandelbulber 2.18-1. Each .png image was placed in a folder with known location. I then dragged all the images and dropped them into a Mathematica notebook.

The images were separated by a space only. I manually placed the images between curly braces and put a comma between each pair and assigned them to the name "images". The following code generated an animated .gif exactly as intended:

Export["Madelbulb.gif", images,"AnimationRepetitions" -> \[Infinity]]

However, I can envision a much larger project and am wondering if there is a way to import the images as a comma separated list automatically? This was 300 images. Already quite mind numbing with the commas.

$\endgroup$
2
$\begingroup$

Put all the images in a folder by themselves, then use the following code:

imagePaths = FileNames["path/to/images/*.png"];
images = Import /@ imagePaths;
$\endgroup$
  • $\begingroup$ That works perfectly. $\endgroup$ – JEM Jun 14 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.