To generate image please use the following steps:

H2O

serialize struct to string:

const struct = await ketcher.getKet()

generate Blob:

const imgBlob = await ketcher.generateImage(struct) - png

or

const imgBlob = await ketcher.generateImage(struct, *options)

*options is an object with 'outputFormat' ('svg' or 'png') and 'backgroundColor' (optional) properties. for example:

let options = {outputFormat: 'svg'}

Also see issue