diff --git a/ais.module b/ais.module
index fc46e40..eb07087 100644
--- a/ais.module
+++ b/ais.module
@@ -338,3 +338,65 @@ function _ais_cmp_styles( $a, $b) {
   return $a['size'] < $b['size'] ? -1 : 1;
 }
 
+/**
+ * Implements hook_filter_info().
+ *
+ * Add class="adaptive" to all IMG tags.
+ */
+function ais_filter_info() {
+  $filters['filter_adaptive_image_styles'] = array(
+    'title' => t('Adaptive Image Styles'),
+    'description' => t('Add the class "adaptive" to all <em>&lt;img&gt;</em> tags.'),
+    'process callback' => '_ais_filter_adaptive_image_styles_process',
+    'tips callback' => '_ais_filter_adaptive_image_styles_tips',
+  );
+  return $filters;
+}
+
+/**
+ * Adaptive Image Styles filter process callback.
+ *
+ * Add class="adaptive" to all IMG tags.
+ */
+function _ais_filter_adaptive_image_styles_process($text, $filter) {
+  $dom = new DOMDocument();
+  // this is not a fully-specified HTML document with a charset declaration, so
+  // make sure we treat incoming text as UTF-8
+  @$dom->loadHTML('<?xml encoding="UTF-8">' . $text);
+  // remove this placeholder tag & manually set the correct encoding
+  foreach ($dom->childNodes as $item) {
+    if ($item->nodeType == XML_PI_NODE) {
+      $dom->removeChild($item); // remove hack
+    }
+  }
+  $dom->encoding = 'UTF-8'; // insert proper
+  // modify img tags to add the class 'adaptive', leaving in place any existing
+  // classes
+  $dom_path = new DOMXPath($dom);
+  foreach($dom_path->query("//img") as $node) {
+    $classes = array();
+    if ($node->hasAttribute("class")) {
+      $classes = explode(' ', $node->getAttribute("class"));
+    }
+    $classes[] = 'adaptive';
+    $node->setAttribute("class", implode(' ', array_unique($classes)));
+  }
+  return $dom->saveHtml();
+}
+
+/**
+ * Filter tips callback for adaptive_image_styles filter.
+ *
+ * The tips callback allows filters to provide help text to users during the
+ * content editing process. Short tips are provided on the content editing
+ * screen, while long tips are provided on a separate linked page. Short tips
+ * are optional, but long tips are highly recommended.
+ */
+function _ais_filter_adaptive_image_styles_tips($filter, $format, $long = FALSE) {
+  $tip = t('The class "adaptive" will be added to all <em>&lt;img&gt;</em> tags.');
+  if (!$long) {
+    return $tip;
+  }
+  $tip .= '<br />' . t('When used with the module <a href="https://drupal.org/project/ais">Adaptive Image Styles</a> (AIS), this filter will modify inline images to fix the current browser width.');
+  return $tip;
+}
