code: def do_quality(self, quality):
          
          infile = self.tmpfile
          outfile = self.basename + '.col'
          # Quality (bit-depth):
          if (quality == 'grey' or quality == 'gray'):
              if (self.shell_call('cat ' + infile + ' | ' + self.ppmtopgm + ' > ' + outfile)):
                  raise IIIFError(
                      text="Oops... got nonzero output from ppmtopgm.")
              self.tmpfile = outfile
          elif (quality == 'bitonal'):
              if (self.shell_call('cat ' + infile + ' | ' + self.ppmtopgm + ' | ' + self.pamditherbw + ' > ' + outfile)):
                  raise IIIFError(
                      text="Oops... got nonzero output from ppmtopgm.")
              self.tmpfile = outfile
          elif ((quality == 'native' and self.api_version < '2.0') or
                (quality == 'default' and self.api_version >= '2.0') or
                quality == 'color'):
              self.tmpfile = infile
          else:
              raise IIIFError(code=400, parameter='quality',
                              text="Unknown quality parameter value requested.")
docs: Apply value of quality parameter.