Using ImageStyle with dependency injection
Yes, inject the entity_type.manager service and load it that way:

$url = $this-&gt;entityTypeManager
  -&gt;getStorage('image_style')
  -&gt;load('machine_name')
  -&gt;buildUrl($path);