How to get image with image style path to a twig template I had created a field called tv_adbackground on the settings filed to be a ble to uplaod a background image. 

The upload works great!

How to get the path of the file or the image style medium or thumbinal in to a twig template like this?

...
 &lt;div id="advertisement"&gt; &lt;!-- background-image uploaded on theme settings page should be used here -&gt;


 &lt;div id=advertisement-dimmer&gt;

 &lt;h3 class="adheading"&gt;{{ tv_adheading }}&lt;/h3&gt;

&lt;div id="admessage"&gt;{{ tv_admessage }}

&lt;div class="btn-group adbuttons" role="group" aria-label="Basic    
example"&gt;
&lt;button type="button" class="btn btn-primary btn-lg"&gt;&lt;a 
style="color:#fff;" href="/signup"&gt;Register&lt;/a&gt;   
&lt;/button&gt;
&lt;button type="button" class="btn btn-default btn-lg"&gt;&lt;a 
href="/user/login"&gt;Login&lt;/a&gt;&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;






I would use css to retrive thte image path but with css i dont get teh variable to get the file path.

I am new to drupal 8 so it would be great if there will be  anyone to help
It can be done with the help of two additional modules. 


Twig Field Value - to get the path to the image and 
Twig Tweak - to get the image style version of an image.


Then in your Twig template you would use something like this to get the image style path:

{{ content.field_image.entity.uri.value | image_style('medium') }}


where field_image is the name of the image field.

If you use something like the Media module then your images come from a referenced entity. In that case you could use

{{ file_url(content.field_referenced_entity | field_target_entity.field_image.entity.uri.value | image_style('medium')) }}


and field_referenced_entity would be the media/entity reference field and field_image the name of the image field on the referenced entity. Notice that in the second case the whole path is wrapped in file_url().