Hello linshuh,
Try this:
def main():
app = Metashape.app
app.model_view.model_view_mode = Metashape.Application.ModelView.ModelViewSolid #<--- change view mode. Don't want default colored model
doc = app.document
doc.open('test_screenshot_solid.psz')
image = Metashape.app.model_view.captureView(width = 300, height = 150, transparent = False, hide_items = True)
cap = Metashape.Image(image.width, image.height, "RGBA", "U8")
image.save('cameratest.png')
See section "Metashape.Image" in Metashape Python API for more information on the arguments.
Best regards,
Sébastien