I am wondering in what cases I should or must use BitmapCreateOptions.PreservePixelFormat when reading an image into a BitmapSource or BitmapImage. I suppose that PreservePixelFormat could be necessary in some cases when transforming a BitmapSource or reading the pixels, editing them and saving the pixels as a new image file.
Would be nice if someone could clarify in which cases BitmapCreateOptions.PreservePixelFormat is necessary or offers an (performance?) advantage.
From the Remarks in BitmapCreateOptions:
When the option is not set, WPF may decode a bitmap in a format other than that is stored in the source file to optimize performance. The original bitmap may perhaps be encoded as paletted bitmap, but WPF may decode it as 32 bits per pixel bitmap because the target platform better supports that format.