public static byte[] SaveImage(this Frame frame, OutputFormat?format = null, string?formatName = null)
        {
            using FormatContext fc = FormatContext.AllocOutput(format, formatName);
            using var io           = MediaIO.OpenDynamic();
            fc.IO = io;
            WriteImageTo(frame, fc);

            using var dm = io.GetBufferAndClose();
            return(dm.AsSpan().ToArray());
        }