You can simply call Highgui.imwrite on the Mat as Alexander has already answered here. Quoting from the docs of function: