diff --git a/src/Plugin/ImageAPIOptimizeProcessor/PngQuant.php b/src/Plugin/ImageAPIOptimizeProcessor/PngQuant.php
index 30f9824..9eacf22 100644
--- a/src/Plugin/ImageAPIOptimizeProcessor/PngQuant.php
+++ b/src/Plugin/ImageAPIOptimizeProcessor/PngQuant.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor;
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase;
 
 /**
@@ -25,21 +26,88 @@ class PngQuant extends ImageAPIOptimizeProcessorBinaryBase {
   public function applyToImage($image_uri) {
     if ($cmd = $this->getFullPathToBinary()) {
 
-      if ($this->getMimeType($image_uri) == 'image/png') {
+      if ($this->getMimeType($image_uri) === 'image/png') {
         $dst = $this->sanitizeFilename($image_uri);
-        $options = array(
-          '--speed=1',
-          '--quality=90-99',
+        $options = [
           '--force',
-          '--ext .png'
-        );
-        $arguments = array(
+        ];
+
+        if (!empty($this->configuration['quality'])) {
+          $options[] = '--quality=' . escapeshellarg($this->configuration['quality']);
+        }
+
+        if (!empty($this->configuration['speed'])) {
+          $options[] = '--speed=' . escapeshellarg($this->configuration['speed']);
+        }
+
+        if (!empty($this->configuration['ext'])) {
+          $options[] = '--ext ' . escapeshellarg($this->configuration['ext']);
+        }
+
+        $arguments = [
           $dst,
-        );
+        ];
 
         return $this->execShellCommand($cmd, $options, $arguments);
       }
     }
     return FALSE;
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function defaultConfiguration() {
+    return parent::defaultConfiguration() + [
+        'speed' => '1',
+        'quality' => '90-99',
+        'ext' => '.png',
+      ];
+  }
+
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
+    $form = parent::buildConfigurationForm($form, $form_state);
+
+    $form['speed'] = [
+      '#title' => $this->t('Speed'),
+      '#type' => 'select',
+      '#options' => array_combine(range(1, 10), range(1, 10)),
+      '#default_value' => $this->configuration['speed'],
+      '#description' => $this->t('1 (brute-force) to 10 (fastest). The default is 3. Speed 10 has 5% lower quality, but is about 8 times faster than the default.'),
+    ];
+
+    $form['quality'] = [
+      '#title' => $this->t('Quality'),
+      '#type' => 'textfield',
+      '#default_value' => $this->configuration['quality'],
+      '#description' => $this->t('min and max are numbers in range 0 (worst) to 100 (perfect), similar to JPEG.<br/>
+    pngquant will use the least amount of colors required to meet or exceed the max quality.<br/>
+    If conversion results in quality below the min quality the image won‘t be saved<br/>
+    (or if outputting to stdin, 24-bit original will be output) and pngquant will<br/>
+    exit with status code 99.'),
+    ];
+
+    $form['ext'] = [
+      '#title' => $this->t('File extension'),
+      '#type' => 'textfield',
+      '#default_value' => $this->configuration['ext'],
+      '#description' => $this->t('File extension (suffix) to use for output files instead of the default ‘-fs8.png’ or ‘-or8.png’.'),
+    ];
+
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
+    parent::submitConfigurationForm($form, $form_state);
+
+    $this->configuration['speed'] = $form_state->getValue('speed');
+    $this->configuration['quality'] = $form_state->getValue('quality');
+    $this->configuration['ext'] = $form_state->getValue('ext');
+  }
+
 }
+
