Move an image along a trajectory

An (transparent or animated) image moves along a trajectory in front of a background image. Output is an animated GIF, PNG or MP4 file.
8 Downloads
Updated 31 Mar 2025

View License

1 Features
  • Move a small (partly transparent) image on top of a background image along a trajectory.
  • Have two points of the small image glide along the trajectory.
  • Rotate the small image accordingly.
  • Process also animated GIF or APNG small images.
  • Output as GIF or APNG file or MP4 video.
  • All inputs for ‘moveImage’ are optional and explained in the file itself.
  • No toolbox required
Six examples are included in the submission.
For details see the enclosed pdf document
2 Requirements
For reading and writing animated PNG files you need to download two exe-files:
and put the exe-files in the same folder as ‘moveImage.m’.

Cite As

Peter Seibold (2025). Move an image along a trajectory (https://in.mathworks.com/matlabcentral/fileexchange/180355-move-an-image-along-a-trajectory), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.1

New introduction image.

1.3.0

Removed bug for gay scaled images.

1.2.0

The interpolation for the rotation of the transparency is forced to 'nearest'. In most cases 'nearest' is visually better than 'bilinear' or 'cubic'.

1.1.0

Removed a major bug when a small image has no transparency.

1.0.1

removed a typing error in summary.

1.0.0