There is no specification and there is no algorithm that will define what moves and what is still. Cinemagraphs are an art form. It’s the artist’s choice that makes the difference between a simple animated gif or video and an appealing cinemagraph.
I think you did not fully understand what this is about so you will have difficulties to implement a software for creating cinemagraphs.
Any software that is able to blend images and export videos or animated gifs can be used to create cinemagraphs. So maybe start with these features.