If you want to change between arbitrary SVG images (or VectorDrawable ), you need to align the appropriate paths to make them compatible for morphing . This is a very tedious task, but there is a command line tool that can do this for you: VectAling
You just need to run the VectAlign tool from the command line, passing the source paths, and it will automatically create βmorphingβ sequences.
Usage example:
java -jar vectalign.jar --start "M 10,20..." --end "M 30,30..."
Output:
-------------------- ALIGNMENT RESULT -------------------- # new START sequence: M 48.0,54.0 L 31.0,42.0 L 15.0,54.0 L 21.0,35.0 L 6.0,23.0 L 25.0,23.0 L 25.0,23.0 L 25.0,23.0 L 25.0,23.0 L 32.0,4.0 L 40.0,23.0 L 58.0,23.0 L 42.0,35.0 L 48.0,54.0 # new END sequence: M 48.0,54.0 L 48.0,54.0 L 48.0,54.0 L 48.0,54.0 L 31.0,54.0 L 15.0,54.0 L 10.0,35.0 L 6.0,23.0 L 25.0,10.0 L 32.0,4.0 L 40.0,10.0 L 58.0,23.0 L 54.0,35.0 L 48.0,54.0
Now you can use these new sequences in your Android project and convert between them, as usual, using AnimatedVectorDrawable !
You can also transfer SVG files :
java -jar vectalign.jar --start image1.svg --end image2.svg
This is one example from the VectAlign demo :
