diff --git a/core/modules/image/src/Form/ImageEffectEditForm.php b/core/modules/image/src/Form/ImageEffectEditForm.php
index 1e2ba85..74a99cf 100644
--- a/core/modules/image/src/Form/ImageEffectEditForm.php
+++ b/core/modules/image/src/Form/ImageEffectEditForm.php
@@ -16,11 +16,20 @@
 class ImageEffectEditForm extends ImageEffectFormBase {
 
   /**
+   * The image effect UUID.
+   *
+   * @var string
+   */
+  protected $imageEffectId;
+
+  /**
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state, ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
     $form = parent::buildForm($form, $form_state, $image_style, $image_effect);
 
+    $this->imageEffectId = $image_effect;
+
     $form['#title'] = $this->t('Edit %label effect', array('%label' => $this->imageEffect->label()));
     $form['actions']['submit']['#value'] = $this->t('Update effect');
 
@@ -34,4 +43,23 @@ protected function prepareImageEffect($image_effect) {
     return $this->imageStyle->getEffect($image_effect);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function __sleep() {
+    $vars = parent::__sleep();
+    $vars = array_diff($vars, ['imageEffect']);
+    return $vars;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __wakeup() {
+    parent::__wakeup();
+    if ($this->imageStyle && $this->imageStyle instanceof ImageStyleInterface) {
+      $this->imageEffect = $this->imageStyle->getEffect($this->imageEffectId);
+    }
+  }
+
 }
diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php
index 8426337..3ac9952 100644
--- a/core/modules/image/src/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Tests;
 
 use Drupal\Component\Utility\String;
+use Drupal\image\Entity\ImageStyle;
 use Drupal\image\ImageStyleInterface;
 use Drupal\node\Entity\Node;
 
@@ -274,6 +275,45 @@ function testStyle() {
   }
 
   /**
+   * Test for editing Ajax enabled effect forms.
+   */
+  function testAjaxEnabledEffectForm() {
+    $admin_path = 'admin/config/media/image-styles';
+
+    // Setup a style to be created and effects to add to it.
+    $style_name = strtolower($this->randomMachineName(10));
+    $style_label = $this->randomString();
+    $style_path = $admin_path . '/manage/' . $style_name;
+    $effect_edit = array(
+      'data[test_parameter]' => 100,
+    );
+
+    // Add style form.
+    $edit = array(
+      'name' => $style_name,
+      'label' => $style_label,
+    );
+    $this->drupalPostForm($admin_path . '/add', $edit, t('Create new style'));
+    $this->assertRaw(t('Style %name was created.', array('%name' => $style_label)));
+
+    // Add two Ajax-enabled test effects.
+    $this->drupalPostForm($style_path, array('new' => 'image_module_test_ajax'), t('Add'));
+    $this->drupalPostForm(NULL, $effect_edit, t('Add effect'));
+    $this->drupalPostForm($style_path, array('new' => 'image_module_test_ajax'), t('Add'));
+    $this->drupalPostForm(NULL, $effect_edit, t('Add effect'));
+
+    // Load the saved image style.
+    $style = $style = ImageStyle::load($style_name);
+
+    // Edit back the effects.
+    foreach ($style->getEffects() as $uuid => $effect) {
+      $effect_path = $style_path = $admin_path . '/manage/' . $style_name . '/effects/' . $uuid;
+      $this->drupalPostForm($effect_path, $effect_edit, t('Update effect'));
+    }
+
+  }
+
+  /**
    * Test deleting a style and choosing a replacement style.
    */
   function testStyleReplacement() {
diff --git a/core/modules/image/tests/modules/image_module_test/config/schema/image_module_test.schema.yml b/core/modules/image/tests/modules/image_module_test/config/schema/image_module_test.schema.yml
index a36719d..7cc34fa 100644
--- a/core/modules/image/tests/modules/image_module_test/config/schema/image_module_test.schema.yml
+++ b/core/modules/image/tests/modules/image_module_test/config/schema/image_module_test.schema.yml
@@ -1,3 +1,11 @@
+image.effect.image_module_test_ajax:
+  type: mapping
+  label: 'Ajax test'
+  mapping:
+    test_parameter:
+      type: integer
+      label: 'Test Parameter'
+
 image_style.third_party.image_module_test:
   type: mapping
   label: 'Schema for image_module_test module additions to image_style entity'
diff --git a/core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/AjaxTestImageEffect.php b/core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/AjaxTestImageEffect.php
new file mode 100644
index 0000000..8e1e393
--- /dev/null
+++ b/core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/AjaxTestImageEffect.php
@@ -0,0 +1,92 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\image_module_test\Plugin\ImageEffect\AjaxTestImageEffect.
+ */
+
+namespace Drupal\image_module_test\Plugin\ImageEffect;
+
+use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Ajax\HtmlCommand;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Image\ImageInterface;
+use Drupal\image\ConfigurableImageEffectBase;
+
+
+/**
+ * Provides a test effect using Ajax in the configuration form.
+ *
+ * @ImageEffect(
+ *   id = "image_module_test_ajax",
+ *   label = @Translation("Ajax test")
+ * )
+ */
+class AjaxTestImageEffect extends ConfigurableImageEffectBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function defaultConfiguration() {
+    return array(
+      'test_parameter' => 0,
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
+    $form['test_parameter'] = array(
+      '#type' => 'number',
+      '#title' => t('Test parameter'),
+      '#default_value' => $this->configuration['test_parameter'],
+      '#min' => 0,
+    );
+    $form['ajax_refresh'] = array(
+      '#type'  => 'button',
+      '#value' => $this->t('Ajax refresh'),
+      '#ajax'  => array(
+        'callback' => array($this, 'ajaxCallback'),
+      ),
+    );
+    $form['ajax_value'] = array(
+      '#id'   => 'ajax-value',
+      '#type'   => 'item',
+      '#title' => $this->t('Ajax value'),
+      '#markup' => 'bar',
+    );
+    return $form;
+  }
+
+  /**
+   * AJAX callback.
+   */
+  public function ajaxCallback($form, FormStateInterface $form_state) {
+    $item = array(
+      '#type'   => 'item',
+      '#title' => $this->t('Ajax value'),
+      '#markup' => microtime(),
+    );
+    $response = new AjaxResponse();
+    $response->addCommand(new HtmlCommand('#ajax-value', drupal_render($item)));
+    return $response;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
+    parent::submitConfigurationForm($form, $form_state);
+
+    $this->configuration['test_parameter'] = $form_state->getValue('test_parameter');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function applyEffect(ImageInterface $image) {
+    return TRUE;
+  }
+
+}
