To safely ensure that a picture is either 32 bit or 24 bit deep and valid in other ways for usage with PictureEffects filters then use the EnsurePictureCompatible function.
This function should only be used with filters that support both 32 bit and 24 bit Pictures. For filters that only support 32bit images then use the EnsurePictureBits function.
This function can be very fast since it will only copy the original picture when it does not fit the required specs for a 32 bit or 24 bit picture.
This function is only for usage with effects that do not alter the original image. This is very important to remember that the picture returned from this function is not mutable.