docs: public WritableRaster filter(Raster src, WritableRaster dest) {
          Validate.notNull(src, "src may not be null");
          // TODO: Why not allow same raster, if converting to 4 byte ABGR?
          Validate.isTrue(src != dest, "src and dest raster may not be same");
          Validate.isTrue(src.getTransferType() == DataBuffer.TYPE_BYTE, src, "only TYPE_BYTE rasters supported as src: %s");
          Validate.isTrue(src.getNumDataElements() >= 4, src.getNumDataElements(), "CMYK raster must have at least 4 data elements: %s");
  
          if (dest == null) {
              dest = createCompatibleDestRaster(src);
          }
          else {
              Validate.isTrue(
                      dest.getTransferType() == DataBuffer.TYPE_BYTE && dest.getNumDataElements() >= 3 ||
                              dest.getTransferType() == DataBuffer.TYPE_INT && dest.getNumDataElements() == 1,
                      src,
                      "only 3 or 4 byte TYPE_BYTE or 1 int TYPE_INT rasters supported as dest: %s"
              );
          }
  
          final int height = src.getHeight();
          final int width = src.getWidth();
  
          final byte[] in = new byte[src.getNumDataElements()]; // CMYK
  
          if (dest.getTransferType() == DataBuffer.TYPE_BYTE) {
              final byte[] out = new byte[dest.getNumDataElements()];
  
              if (out.length > 3) {
                  out[3] = (byte) 0xFF;
              }
  
              for (int y = dest.getMinY(); y < height; y++) {
                  for (int x = dest.getMinX(); x < width; x++) {
                      src.getDataElements(x, y, in);
                      convertCMYKToRGB(in, out);
                      dest.setDataElements(x, y, out);
                  }
              }
          }
          else if (dest.getTransferType() == DataBuffer.TYPE_INT) {
              final int[] out = new int[dest.getNumDataElements()];
              final byte[] temp = new byte[3]; // RGB
  
              // Special case for INT_BGR types, as bit offsets are not handled in setDataElements like for the byte raster case
              int[] bitOffsets;
              SampleModel sm = dest.getSampleModel();
              if (sm instanceof SinglePixelPackedSampleModel) {
                  bitOffsets = ((SinglePixelPackedSampleModel) sm).getBitOffsets();
              }
              else {
                  bitOffsets = new int[]{0, 8, 16};
              }
  
              final int alpha = bitOffsets.length > 3 ? 0xFF : 0x00;
  
              for (int y = dest.getMinY(); y < height; y++) {
                  for (int x = dest.getMinX(); x < width; x++) {
                      src.getDataElements(x, y, in);
                      convertCMYKToRGB(in, temp);
                      out[0] = alpha << 24 | (temp[0] & 0xFF) << bitOffsets[0] | (temp[1] & 0xFF) << bitOffsets[1] | (temp[2] & 0xFF) << bitOffsets[2];
                      dest.setDataElements(x, y, out);
                  }
              }
          }
          else {
              // This is already tested for
              throw new AssertionError();
          }
  
          return dest;
      }