I've created an image 'field_term_preview' field on the taxonomy vocabulary and trying to get this URL in my custom module:
$terms =\Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid, 0, null, true); foreach ($terms as $term) { if ($term->getName = 'Term with preview') { foreach ($term->getFields(true) as $field) { if ($field->getName() == 'field_term_preview') { var_dump($field->getValue()); } } } } This code shows only target_id, alt, height, etc. 
How to get the URL to the preview image?