Hi,
to export in png you should produce the PNG itself. Using JSON.stringify only converts the map object (that is the configuration object of the map) in a string.
Implement it is not trivial (or at least, not in all the cases. you may have some encounter some cross origin issues). If you are on your custom project, using openlayers and you don't have cross origin issues, you can try to get the image from canvas of the map (it will get a sort of a screenshot of the current map).
There is an old "snapshot" plugin that provides this functionality, but is not maintained by us for a long time.