...
diff --git a/MagickCore/compare.c b/MagickCore/compare.c
index 742836b..48a7425 100644
--- a/MagickCore/compare.c
+++ b/MagickCore/compare.c
@@ -1313,6 +1313,33 @@
   return(status);
 }
 
+static MagickBooleanType GetStructuralSimilarityDistortion(const Image *image,
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
+{
+  MagickBooleanType
+    status;
+
+  register ssize_t
+    i;
+
+  status=GetMeanSquaredDistortion(image,reconstruct_image,distortion,exception);
+  for (i=0; i <= MaxPixelChannels; i++)
+    distortion[i]=sqrt(distortion[i]);
+  return(status);
+}
+
+static MagickBooleanType GetStructuralDisimilarityDistortion(const Image *image,
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
+{
+  MagickBooleanType
+    status;
+
+  status=GetStructuralSimilarityDistortion(image,reconstruct_image,
+    distortion,exception);
+  *distortion=(1.0-(*distortion))/2.0;
+  return(status);
+}
+
 MagickExport MagickBooleanType GetImageDistortion(Image *image,
   const Image *reconstruct_image,const MetricType metric,double *distortion,
   ExceptionInfo *exception)
@@ -1409,6 +1436,18 @@
         channel_distortion,exception);
       break;
     }
+    case StructuralSimilarityErrorMetric:
+    {
+      status=GetStructuralSimilarityDistortion(image,reconstruct_image,
+        channel_distortion,exception);
+      break;
+    }
+    case StructuralDissimilarityErrorMetric:
+    {
+      status=GetStructuralDisimilarityDistortion(image,reconstruct_image,
+        channel_distortion,exception);
+      break;
+    }
   }
   *distortion=channel_distortion[CompositePixelChannel];
   channel_distortion=(double *) RelinquishMagickMemory(channel_distortion);
diff --git a/MagickCore/compare.h b/MagickCore/compare.h
index 79bf6ad..b34baa3 100644
--- a/MagickCore/compare.h
+++ b/MagickCore/compare.h
@@ -36,7 +36,9 @@
   PeakAbsoluteErrorMetric,
   PeakSignalToNoiseRatioErrorMetric,
   PerceptualHashErrorMetric,
-  RootMeanSquaredErrorMetric
+  RootMeanSquaredErrorMetric,
+  StructuralSimilarityErrorMetric,
+  StructuralDissimilarityErrorMetric
 } MetricType;
 
 extern MagickExport double
diff --git a/MagickCore/option.c b/MagickCore/option.c
index 2fb5517..63d9994 100644
--- a/MagickCore/option.c
+++ b/MagickCore/option.c
@@ -1443,6 +1443,7 @@
     { "PHASH", PerceptualHashErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "PSNR", PeakSignalToNoiseRatioErrorMetric, UndefinedOptionFlag, MagickFalse },
     { "RMSE", RootMeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
+    { "SSIM", StructuralSimilarityErrorMetric, UndefinedOptionFlag, MagickFalse },
     { (char *) NULL, UndefinedErrorMetric, UndefinedOptionFlag, MagickFalse }
   },
   MethodOptions[] =
diff --git a/configure b/configure
index 999c83d..e71c6a7 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ImageMagick 7.0.6-8.
+# Generated by GNU Autoconf 2.69 for ImageMagick 7.0.6-9.
 #
 # Report bugs to <https://github.com/ImageMagick/ImageMagick/issues>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='ImageMagick'
 PACKAGE_TARNAME='ImageMagick'
-PACKAGE_VERSION='7.0.6-8'
-PACKAGE_STRING='ImageMagick 7.0.6-8'
+PACKAGE_VERSION='7.0.6-9'
+PACKAGE_STRING='ImageMagick 7.0.6-9'
 PACKAGE_BUGREPORT='https://github.com/ImageMagick/ImageMagick/issues'
 PACKAGE_URL='https://www.imagemagick.org'
 
@@ -1826,7 +1826,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ImageMagick 7.0.6-8 to adapt to many kinds of systems.
+\`configure' configures ImageMagick 7.0.6-9 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1901,7 +1901,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ImageMagick 7.0.6-8:";;
+     short | recursive ) echo "Configuration of ImageMagick 7.0.6-9:";;
    esac
   cat <<\_ACEOF
 
@@ -2179,7 +2179,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ImageMagick configure 7.0.6-8
+ImageMagick configure 7.0.6-9
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -3230,7 +3230,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ImageMagick $as_me 7.0.6-8, which was
+It was created by ImageMagick $as_me 7.0.6-9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4216,7 +4216,7 @@
 
 # Define the identity of the package.
  PACKAGE='ImageMagick'
- VERSION='7.0.6-8'
+ VERSION='7.0.6-9'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4526,11 +4526,11 @@
 
 MAGICK_MICRO_VERSION=6
 
-MAGICK_PATCHLEVEL_VERSION=8
+MAGICK_PATCHLEVEL_VERSION=9
 
-MAGICK_VERSION=7.0.6-8
+MAGICK_VERSION=7.0.6-9
 
-MAGICK_GIT_REVISION=20819:6e663f7e3:20170815
+MAGICK_GIT_REVISION=20847:4575049ec:20170819
 
 
 # Substitute library versioning
@@ -38589,7 +38589,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ImageMagick $as_me 7.0.6-8, which was
+This file was extended by ImageMagick $as_me 7.0.6-9, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -38656,7 +38656,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ImageMagick config.status 7.0.6-8
+ImageMagick config.status 7.0.6-9
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 2f28f60..7d27c62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@
 m4_define([magick_major_version], [7])
 m4_define([magick_minor_version], [0])
 m4_define([magick_micro_version], [6])
-m4_define([magick_patchlevel_version], [8])
+m4_define([magick_patchlevel_version], [9])
 m4_define([magick_version],
           [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
 m4_define([magick_git_revision], esyscmd([sh -c "(gitversion.sh .) | tr -d '\n'"]))
diff --git a/version.sh b/version.sh
index 1c15ecb..e754dfa 100644
--- a/version.sh
+++ b/version.sh
@@ -18,7 +18,7 @@
 PACKAGE_VERSION='7.0.6'
 PACKAGE_PERL_VERSION='7.06'
 PACKAGE_LIB_VERSION="0x706"
-PACKAGE_RELEASE="8"
+PACKAGE_RELEASE="9"
 PACKAGE_LIB_VERSION_NUMBER="7,0,6,${PACKAGE_RELEASE}"
 PACKAGE_RELEASE_DATE_RAW=`date +%F`
 PACKAGE_RELEASE_DATE_REPRODUCIBLE="${PACKAGE_CHANGE_DATE}"