/// <summary>
        /// Saves the specified image.
        /// </summary>
        /// <typeparam name="TColor">Image color.</typeparam>
        /// <param name="image">Image to save.</param>
        /// <param name="fileName">Image filename.</param>
        private unsafe static void Save <TColor>(this Image <TColor> image, string fileName)
            where TColor : struct, IColor
        {
            var iplImage = image.AsOpenCvImage();

            CvHighGuiInvoke.cvSaveImage(fileName, &iplImage, IntPtr.Zero);
        }
 /// <summary>
 /// Saves the specified image.
 /// </summary>
 /// <typeparam name="TColor">Image color.</typeparam>
 /// <param name="image">Image to save.</param>
 /// <param name="fileName">Image filename.</param>
 private unsafe static void Save <TColor>(this TColor[,] image, string fileName)
     where TColor : struct, IColor
 {
     using (var img = image.Lock())
     {
         var iplImage = img.AsOpenCvImage();
         CvHighGuiInvoke.cvSaveImage(fileName, &iplImage, IntPtr.Zero);
     }
 }
        /// <summary>
        /// Saves the provided image. If the image has non-supported color or depth false value is returned.
        /// </summary>
        /// <param name="image">Image to save.</param>
        /// <param name="fileName">Filename.</param>
        /// <returns>True if the image is saved, false otherwise.</returns>
        public unsafe static bool TrySave(IImage image, string fileName)
        {
            IplImage iplImage = default(IplImage);

            try
            {
                iplImage = image.AsOpenCvImage();
            }
            catch
            {
                return(false);
            }

            CvHighGuiInvoke.cvSaveImage(fileName, &iplImage, IntPtr.Zero);
            return(true);
        }