code: def _validate_j2k_colorspace(self, cparams, colorspace):
          
          if cparams.codec_fmt == opj2.CODEC_J2K and colorspace is not None:
              msg = 'Do not specify a colorspace when writing a raw codestream.'
              raise IOError(msg)
docs: Cannot specify a colorspace with J2K.