{"id":15984,"date":"2021-10-11T13:17:45","date_gmt":"2021-10-11T11:17:45","guid":{"rendered":"https:\/\/manual.keyshot.com\/keyshot11\/?post_type=manual_documentation&#038;p=15984"},"modified":"2021-10-12T10:33:15","modified_gmt":"2021-10-12T08:33:15","slug":"scripting-render-image","status":"publish","type":"manual_documentation","link":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/","title":{"rendered":"Scripting: Render image"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Render Image <sup>(GUI and Headless)<\/sup><\/h2>\n\n\n\n<p>Assuming you have already loaded a BIP file, or imported some geometry, and you want to render to an image with scripting then do the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; lux.renderImage(\"\/path\/to\/save\/image.png\", width = 1200, height = 1000)<\/code><\/pre>\n\n\n\n<p>In this case we render the image to &#8220;\/path\/to\/save\/image.png&#8221; as a PNG file with dimensions 1200&#215;1000 pixels. <em>Notice that the format of the image is determined from the file extension.<\/em><\/p>\n\n\n\n<p>As with importing, advanced options can be passed using the <em>opts<\/em> option. An example could be to setup for rendering with max time of 10 seconds:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; opts = lux.getRenderOptions()\n&gt;&gt;&gt; opts.setMaxTimeRendering(10)\n&gt;&gt;&gt; lux.renderImage(\"\/path\/to\/save\/image.png\", width = 1200, height = 1000, opts = opts)<\/code><\/pre>\n\n\n\n<p>Another example could be to render using advanced rendering method with 64 samples, 8 threads, and 64 ray bounces:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; opts = lux.getRenderOptions()\n&gt;&gt;&gt; opts.setAdvancedRendering(64)\n&gt;&gt;&gt; opts.setThreads(8)\n&gt;&gt;&gt; opts.setRayBounces(64)\n&gt;&gt;&gt; lux.renderImage(\"\/path\/to\/save\/image.png\", width = 1200, height = 1000, opts = opts)<\/code><\/pre>\n","protected":false},"author":29916,"featured_media":0,"parent":15964,"menu_order":15,"template":"","manualdocumentationcategory":[13],"manual_doc_tag":[],"class_list":["post-15984","manual_documentation","type-manual_documentation","status-publish","hentry","manualdocumentationcategory-keyshot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Scripting: Render image - KeyShot 11 Manual<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scripting: Render image - KeyShot 11 Manual\" \/>\n<meta property=\"og:description\" content=\"Render Image (GUI and Headless) Assuming you have already loaded a BIP file, or imported some geometry, and you want to render to an image with scripting then do the following: In this case we render the image to &#8220;\/path\/to\/save\/image.png&#8221; as a PNG file with dimensions 1200&#215;1000 pixels. Notice that the format of the image [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/\" \/>\n<meta property=\"og:site_name\" content=\"KeyShot 11 Manual\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-12T08:33:15+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-render-image\\\/\",\"url\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-render-image\\\/\",\"name\":\"Scripting: Render image - KeyShot 11 Manual\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/#website\"},\"datePublished\":\"2021-10-11T11:17:45+00:00\",\"dateModified\":\"2021-10-12T08:33:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-render-image\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-render-image\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-render-image\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scripting\",\"item\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Quick Start Scripting\",\"item\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Scripting: Render image\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/#website\",\"url\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/\",\"name\":\"KeyShot 11 Manual\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Scripting: Render image - KeyShot 11 Manual","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/","og_locale":"en_US","og_type":"article","og_title":"Scripting: Render image - KeyShot 11 Manual","og_description":"Render Image (GUI and Headless) Assuming you have already loaded a BIP file, or imported some geometry, and you want to render to an image with scripting then do the following: In this case we render the image to &#8220;\/path\/to\/save\/image.png&#8221; as a PNG file with dimensions 1200&#215;1000 pixels. Notice that the format of the image [&hellip;]","og_url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/","og_site_name":"KeyShot 11 Manual","article_modified_time":"2021-10-12T08:33:15+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/","url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/","name":"Scripting: Render image - KeyShot 11 Manual","isPartOf":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/#website"},"datePublished":"2021-10-11T11:17:45+00:00","dateModified":"2021-10-12T08:33:15+00:00","breadcrumb":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-render-image\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/manual.keyshot.com\/keyshot11\/"},{"@type":"ListItem","position":2,"name":"Scripting","item":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/"},{"@type":"ListItem","position":3,"name":"Quick Start Scripting","item":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/"},{"@type":"ListItem","position":4,"name":"Scripting: Render image"}]},{"@type":"WebSite","@id":"https:\/\/manual.keyshot.com\/keyshot11\/#website","url":"https:\/\/manual.keyshot.com\/keyshot11\/","name":"KeyShot 11 Manual","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/manual.keyshot.com\/keyshot11\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation"}],"about":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/types\/manual_documentation"}],"author":[{"embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/users\/29916"}],"version-history":[{"count":0,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15984\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15964"}],"wp:attachment":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/media?parent=15984"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manualdocumentationcategory?post=15984"},{"taxonomy":"manual_doc_tag","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_doc_tag?post=15984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}