8 – Programmatically create a new image style

I’m creating my own module and I need to programmatically create an image style to use with a new media type.

I have even read almost all of the responsive_image code to try to find where that module creates a new image style.

How can I programmatically create a new image style?