How do I reference an image inside my custom module directory? I want to ship a default image in my custom module. I know I can reference images in the files directory with public://, but how can I properly reference my module's URL path? 

Update: I need to pass this URI to image_style so a raw path to the module directory won't be enough:

  $render_image = [
    '#theme' =&gt; 'image_style',
    '#style_name' =&gt; 'blah',
    '#uri' =&gt; $uri,
    ...
  ];
The \Drupal class has many useful static functions such as moduleHandler. I recommend (for future issues) to first search there, then in the core.services.yml &amp; system.services.yml files for a service or a method that could help.

\Drupal::moduleHandler()-&gt;getModule('foo')-&gt;getPath()