Get path to theme assets in Twig template
you can use {{ base_path ~ directory }} which will fix the absolute problem, no need to do any preprocessing, both of these variables are included by core.

For example

&lt;img src="{{ base_path ~ directory }}/images/logo.png" alt="My Logo" /&gt;


PS. the ~ helper in twig is concatenate.

Edit: at least in the page*.html.twig templates base_path variable is included, possibly you will need to do preprocessing for other templates, you can easily check with {{ dump() }} if the variables are present

// File: THEMENAME.theme in your theme's root directory
function THEMENAME_preprocess(&amp;$variables, $hook)
{
    $variables['base_path'] = base_path();
}