diff --git a/colorbox.inc b/colorbox.inc
index b8d0aaf..e127c04 100644
--- a/colorbox.inc
+++ b/colorbox.inc
@@ -161,4 +161,28 @@ function template_preprocess_colorbox_formatter(&$variables) {
   $variables['attributes']['title'] = $caption;
   $variables['attributes']['rel'] = $gallery_id;
   $variables['attributes']['class'] = $class;
+
+  // if File Entity module is enabled, load attribute values from file entity.
+  if(\Drupal::moduleHandler()->moduleExists('file_entity')) {
+    $item->title = $item->alt = '';
+    // file id of the save file.
+    $fid = $item->target_id;
+    // load file object
+    $file_obj = file_load($fid);
+    $file_array = $file_obj->toArray();
+    // populate the image title
+    if (Unicode::strlen($file_array['field_image_title_text'][0]['value']) != 0 && empty($item->title)) {
+      $variables['image']['#title'] = $file_array['field_image_title_text'][0]['value'];
+      $variables['attributes']['title'] = $file_array['field_image_title_text'][0]['value'];
+    }
+    // populate the image alt text.
+    if (!empty($file_array['field_image_alt_text'][0]['value']) && empty($item->alt)) {
+      $variables['image']['#alt'] = $file_array['field_image_alt_text'][0]['value'];
+    }
+    // populate the width and height of image.
+    foreach (array('width', 'height') as $key) {
+      $variables['image']["#$key"] = $item->$key;
+    }
+  }
+
 }
