// Read byte[] from png file
BinaryReader binReader = new BinaryReader(File.Open(filePath, FileMode.Open));
FileInfo fileInfo = new FileInfor(filePath);
byte[] bytes = binReader.ReadBytes((int)fileInfo.Length);
binReader.Close();
// Init bitmap
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.StreamSource = new MemoryStream(bytes);
bitmap.EndInit();
image.Dispose();
System.GC.SuppressFinalize(image);
BitmapImage bitmapImage = image.Source as BitmapImage;
bitmapImage.UriSource = null;
image.Source = null;