diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index e44f13d..97d433b 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1279,9 +1279,31 @@ function template_preprocess_links(&$variables) {
  *   - title: The title text is displayed when the image is hovered in some
  *     popular browsers.
  *   - attributes: Associative array of attributes to be placed in the img tag.
+ *   - srcset: Array of multiple URI's and sizes/multipliers.
  */
 function template_preprocess_image(&$variables) {
-  $variables['attributes']['src'] = file_create_url($variables['uri']);
+  if (!empty($variables['uri'])) {
+    $variables['attributes']['src'] = file_create_url($variables['uri']);
+  }
+
+  if (!empty($variables['srcset'])) {
+    $srcsets = array();
+    foreach ($variables['srcset'] as $srcset) {
+      // URI is mandatory.
+      if (isset($srcset['uri']) && !empty($srcset['uri'])) {
+        $srcset['src'] = file_create_url($srcset['uri']);
+        $new_source = $srcset['src'];
+        if (isset($srcset['width']) && !empty($srcset['width'])) {
+          $new_source .= ' ' . $srcset['width'];
+        }
+        elseif (isset($srcset['multiplier']) && !empty($srcset['multiplier'])) {
+          $new_source .= ' ' . $srcset['multiplier'];
+        }
+        $srcsets[] = $new_source;
+      }
+    }
+    $variables['attributes']['srcset'] = implode(', ', $srcsets);
+  }
 
   foreach (array('width', 'height', 'alt', 'title') as $key) {
     if (isset($variables[$key])) {
@@ -2554,7 +2576,7 @@ function drupal_common_theme() {
       // - http://dev.w3.org/html5/spec/Overview.html#alt
       // The title attribute is optional in all cases, so it is omitted by
       // default.
-      'variables' => array('uri' => NULL, 'width' => NULL, 'height' => NULL, 'alt' => '', 'title' => NULL, 'attributes' => array()),
+      'variables' => array('uri' => NULL, 'width' => NULL, 'height' => NULL, 'alt' => '', 'title' => NULL, 'attributes' => array(), 'srcset' => array()),
       'template' => 'image',
     ),
     'breadcrumb' => array(
diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
index 4eaa2ec..ac028a2 100644
--- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
+++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
@@ -312,6 +312,15 @@ public function transformDimensions(array &$dimensions) {
   /**
    * {@inheritdoc}
    */
+  public function transformMimeType(&$mime_type) {
+    foreach ($this->getEffects() as $effect) {
+      $effect->transformMimeType($mime_type);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getPathToken($uri) {
     // Return the first 8 characters.
     return substr(Crypt::hmacBase64($this->id() . ':' . $uri, \Drupal::service('private_key')->get() . drupal_get_hash_salt()), 0, 8);
diff --git a/core/modules/image/lib/Drupal/image/ImageEffectBase.php b/core/modules/image/lib/Drupal/image/ImageEffectBase.php
index ea3208a..1961e4a 100644
--- a/core/modules/image/lib/Drupal/image/ImageEffectBase.php
+++ b/core/modules/image/lib/Drupal/image/ImageEffectBase.php
@@ -47,6 +47,12 @@ public function transformDimensions(array &$dimensions) {
   /**
    * {@inheritdoc}
    */
+  public function transformMimeType(&$mime_type) {
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getSummary() {
     return array(
       '#markup' => '',
diff --git a/core/modules/image/lib/Drupal/image/ImageEffectInterface.php b/core/modules/image/lib/Drupal/image/ImageEffectInterface.php
index 66b7f4e..719f0b7 100644
--- a/core/modules/image/lib/Drupal/image/ImageEffectInterface.php
+++ b/core/modules/image/lib/Drupal/image/ImageEffectInterface.php
@@ -37,6 +37,14 @@ public function applyEffect(ImageInterface $image);
   public function transformDimensions(array &$dimensions);
 
   /**
+   * Determines the mime type of the styled image.
+   *
+   * @param string $mime_type
+   *   Mime type to be modified.
+   */
+  public function transformMimeType(&$mime_type);
+
+  /**
    * Returns a render array summarizing the configuration of the image effect.
    *
    * @return array
diff --git a/core/modules/image/lib/Drupal/image/ImageStyleInterface.php b/core/modules/image/lib/Drupal/image/ImageStyleInterface.php
index 0f28b87..3623d88 100644
--- a/core/modules/image/lib/Drupal/image/ImageStyleInterface.php
+++ b/core/modules/image/lib/Drupal/image/ImageStyleInterface.php
@@ -132,6 +132,14 @@ public function createDerivative($original_uri, $derivative_uri);
   public function transformDimensions(array &$dimensions);
 
   /**
+   * Determines the mime type of the styled image.
+   *
+   * @param string $mime_type
+   *   Mime type to be modified.
+   */
+  public function transformMimeType(&$mime_type);
+
+  /**
    * Returns a specific image effect.
    *
    * @param string $effect
diff --git a/core/modules/image/tests/Drupal/image/Tests/ImageStyleTest.php b/core/modules/image/tests/Drupal/image/Tests/ImageStyleTest.php
new file mode 100644
index 0000000..2628485
--- /dev/null
+++ b/core/modules/image/tests/Drupal/image/Tests/ImageStyleTest.php
@@ -0,0 +1,114 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\image\Tests\ImageStyleTest.
+ */
+
+namespace Drupal\image\Tests;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Tests\UnitTestCase;
+use \Drupal\image\Entity\ImageStyle;
+
+/**
+ * @coversDefaultClass \Drupal\image\Entity\ImageStyle
+ *
+ * @group Drupal
+ * @group Image
+ */
+class ImageStyleTest extends UnitTestCase {
+
+  /**
+   * The entity type used for testing.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $entityType;
+
+  /**
+   * The entity manager used for testing.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $entityManager;
+
+  /**
+   * The ID of the type of the entity under test.
+   *
+   * @var string
+   */
+  protected $entityTypeId;
+
+  /**
+   * The effect manager used for testing.
+   *
+   * @var \Drupal\image\ImageEffectManager|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $effectManager;
+
+  /**
+   * The image effect used for testing.
+   *
+   * @var \Drupal\image\ImageEffectInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $imageEffect;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'description' => '',
+      'name' => '\Drupal\image\Entity\ImageStyle unit test',
+      'group' => 'Image',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    $this->entityTypeId = $this->randomName();
+    $this->provider = $this->randomName();
+    $this->entityType = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
+    $this->entityType->expects($this->any())
+                     ->method('getProvider')
+                     ->will($this->returnValue($this->provider));
+    $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager->expects($this->any())
+                        ->method('getDefinition')
+                        ->with($this->entityTypeId)
+                        ->will($this->returnValue($this->entityType));
+    $this->effectManager = $this->getMockBuilder('\Drupal\image\ImageEffectManager')
+        ->disableOriginalConstructor()
+        ->getMock();
+    $container = new ContainerBuilder();
+    \Drupal::setContainer($container);
+  }
+
+  /**
+   * @covers ::transformMimeType
+   */
+  public function testTransformMimeType() {
+    $image_effect_id = $this->randomName();
+    $image_effect = $this->getMockBuilder('\Drupal\image\ImageEffectBase')
+        ->setConstructorArgs(array(array(), $image_effect_id, array()))
+        ->getMock();
+    $image_effect->expects($this->any())
+        ->method('transformMimeType')
+        ->will($this->returnCallback(function (&$mime_type) { $mime_type = 'image/webp';}));
+    $this->effectManager->expects($this->any())
+        ->method('createInstance')
+        ->with($image_effect_id)
+        ->will($this->returnValue($image_effect));
+    \Drupal::getContainer()->set('plugin.manager.image.effect', $this->effectManager);
+
+    $image_style = new ImageStyle(array('effects' => array($image_effect_id => array('id' => $image_effect_id))), $this->entityTypeId);
+    $mime_types = array('image/jpeg', 'image/gif', 'image/png');
+    foreach ($mime_types as $mime_type) {
+      $image_style->transformMimeType($mime_type);
+      $this->assertEquals($mime_type, 'image/webp');
+    }
+  }
+}
