code: public function isImageOptimizationEnabled()
      {
          if ($this->isFastlyEnabled() !== true) {
              return false;
          }
  
          return $this->_scopeConfig->isSetFlag(self::XML_FASTLY_IMAGE_OPTIMIZATIONS);
      }
docs: Determines should Image optimization be used
  
  @return bool