private static Image createImageAndApplyMask(Image original, Mask mask) {
		Image image = original.shallowClone();
		if (original.isRgb()) {
			applyMask(original, image, mask, RED);
			applyMask(original, image, mask, GREEN);
			applyMask(original, image, mask, BLUE);
		} else if (original.isHsv()) {
			applyMask(original, image, mask, HUE);
			applyMask(original, image, mask, SATURATION);
			applyMask(original, image, mask, VALUE);
		}
		return image;
	}