Render and save " view port render image (openGL)" with python directly?
It was actually easy. thanks there is already arguments, to direct output render-image in bpy.ops.render.opengl()  (write_still = &quot;True&quot;)
then most simple case (if keep current scene render setting), once change path(file name) to render thumbnail(openGL view image), then after generate the img , return path as same as before. (so user may not notice it changed)
import bpy

def render_icons(fname):
    render = bpy.context.scene.render
    upath = render.filepath
    render.filepath = fname
    bpy.ops.render.opengl(animation=False, view_context=False, write_still=True)
    bpy.context.scene.render.filepath = upath

I suppose, to enhance this, untill render, set some render propertys of bpy.context.scene.render to fit as thumbnail, then return all property as same as before.
and add option flag (user may manually set those setting, or use preset for icon render)