You can use the generator to create an animation like that.
petpet generator provides a great solution for creating an animation with a hand petting an object. You can scale up or down the image, adjust the position, and select a specific FPS (frame per second).
The default FPS is 16, but 10 may be a bit gentler as shown like the animation in this article. Images with white backgrounds or without backgrounds would result in the best animation.