def METHOD_NAME(context):
    """Call Scene.save_dataset to write a PNG image."""
    with NamedTemporaryFile(suffix='.png', delete=False) as tmp_file:
        context.lscn.save_dataset(context.composite, filename=tmp_file.name)
        context.new_filename = tmp_file.name