[{"data":1,"prerenderedAt":342},["ShallowReactive",2],{"navigation":3,"\u002Fguides\u002Fsandbox":99,"\u002Fguides\u002Fsandbox-surround":337},[4,23,44,78],{"title":5,"path":6,"stem":7,"children":8,"icon":22},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"MCP Setup","\u002Fgetting-started\u002Fmcp-setup","1.getting-started\u002F3.mcp-setup","i-lucide-plug","i-lucide-rocket",{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":43},"CLI","i-lucide-terminal","\u002Fcli","2.cli",[29,33,38],{"title":30,"path":31,"stem":32,"icon":25},"Usage","\u002Fcli\u002Fusage","2.cli\u002F1.usage",{"title":34,"path":35,"stem":36,"icon":37},"Options","\u002Fcli\u002Foptions","2.cli\u002F2.options","i-lucide-sliders-horizontal",{"title":39,"path":40,"stem":41,"icon":42},"Batch & JSON","\u002Fcli\u002Fbatch-json","2.cli\u002F3.batch-json","i-lucide-package",false,{"title":45,"icon":46,"path":47,"stem":48,"children":49,"page":43},"Providers","i-lucide-cpu","\u002Fproviders","3.providers",[50,55,60,65,70,74],{"title":51,"path":52,"stem":53,"icon":54},"Claude (Area-Based)","\u002Fproviders\u002Fclaude","3.providers\u002F1.claude","i-lucide-square",{"title":56,"path":57,"stem":58,"icon":59},"GPT-4o & GPT-5 (Tiling)","\u002Fproviders\u002Fgpt","3.providers\u002F2.gpt","i-lucide-grid-2x2",{"title":61,"path":62,"stem":63,"icon":64},"Gemini (Large Tiles)","\u002Fproviders\u002Fgemini","3.providers\u002F3.gemini","i-lucide-grid-3x3",{"title":66,"path":67,"stem":68,"icon":69},"Llama Vision (Tiles)","\u002Fproviders\u002Fllama","3.providers\u002F4.llama","i-simple-icons-meta",{"title":71,"path":72,"stem":73,"icon":64},"Qwen-VL (Patch Grid)","\u002Fproviders\u002Fqwen","3.providers\u002F5.qwen",{"title":75,"path":76,"stem":77,"icon":59},"DeepSeek-VL (Open Weights)","\u002Fproviders\u002Fdeepseek","3.providers\u002F6.deepseek",{"title":79,"icon":80,"path":81,"stem":82,"children":83,"page":43},"Guides","i-lucide-book-open","\u002Fguides","4.guides",[84,89,94],{"title":85,"path":86,"stem":87,"icon":88},"Python Bindings","\u002Fguides\u002Fpython-bindings","4.guides\u002F1.python-bindings","i-lucide-file-code",{"title":90,"path":91,"stem":92,"icon":93},"Sandbox (Think in Code)","\u002Fguides\u002Fsandbox","4.guides\u002F2.sandbox","i-lucide-flask-conical",{"title":95,"path":96,"stem":97,"icon":98},"Crawler Integration","\u002Fguides\u002Fcrawler-integration","4.guides\u002F3.crawler-integration","i-lucide-globe",{"id":100,"title":90,"body":101,"description":330,"extension":331,"links":332,"meta":333,"navigation":334,"path":91,"seo":335,"stem":92,"__hash__":336},"docs\u002F4.guides\u002F2.sandbox.md",{"type":102,"value":103,"toc":324},"minimark",[104,113,118,121,202,205,212,272,276,287,291,320],[105,106,107,108,112],"p",{},"The ",[109,110,111],"strong",{},"Think in Code"," paradigm lets your agent execute atomic image operations locally — before any pixels reach the LLM. Instead of sending a full 12MP screenshot to read one error log, crop to just that region and save up to 99.9% of the tokens.",[114,115,117],"h2",{"id":116},"operations","Operations",[105,119,120],{},"The sandbox supports a chain of atomic ops:",[122,123,124,137],"table",{},[125,126,127],"thead",{},[128,129,130,134],"tr",{},[131,132,133],"th",{},"Operation",[131,135,136],{},"Purpose",[138,139,140,152,162,172,182,192],"tbody",{},[128,141,142,149],{},[143,144,145],"td",{},[146,147,148],"code",{},"crop",[143,150,151],{},"Extract a sub-region",[128,153,154,159],{},[143,155,156],{},[146,157,158],{},"grayscale",[143,160,161],{},"Drop color channels",[128,163,164,169],{},[143,165,166],{},[146,167,168],{},"binarize",[143,170,171],{},"Threshold to black\u002Fwhite (great for OCR)",[128,173,174,179],{},[143,175,176],{},[146,177,178],{},"resize",[143,180,181],{},"Scale dimensions",[128,183,184,189],{},[143,185,186],{},[146,187,188],{},"contrast",[143,190,191],{},"Adjust contrast",[128,193,194,199],{},[143,195,196],{},[146,197,198],{},"brightness",[143,200,201],{},"Adjust brightness",[114,203,24],{"id":204},"cli",[105,206,207,208,211],{},"Pass operations as JSON via ",[146,209,210],{},"--ops",":",[213,214,220],"pre",{"className":215,"code":216,"filename":217,"language":218,"meta":219,"style":219},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","vision-squeezer screenshot.png --ops '[\n  {\"op\": \"crop\", \"x\": 0, \"y\": 1200, \"width\": 1920, \"height\": 300},\n  {\"op\": \"grayscale\"},\n  {\"op\": \"binarize\", \"threshold\": 128}\n]'\n","Terminal","bash","",[146,221,222,245,251,257,263],{"__ignoreMap":219},[223,224,227,231,235,238,242],"span",{"class":225,"line":226},"line",1,[223,228,230],{"class":229},"sBMFI","vision-squeezer",[223,232,234],{"class":233},"sfazB"," screenshot.png",[223,236,237],{"class":233}," --ops",[223,239,241],{"class":240},"sMK4o"," '",[223,243,244],{"class":233},"[\n",[223,246,248],{"class":225,"line":247},2,[223,249,250],{"class":233},"  {\"op\": \"crop\", \"x\": 0, \"y\": 1200, \"width\": 1920, \"height\": 300},\n",[223,252,254],{"class":225,"line":253},3,[223,255,256],{"class":233},"  {\"op\": \"grayscale\"},\n",[223,258,260],{"class":225,"line":259},4,[223,261,262],{"class":233},"  {\"op\": \"binarize\", \"threshold\": 128}\n",[223,264,266,269],{"class":225,"line":265},5,[223,267,268],{"class":233},"]",[223,270,271],{"class":240},"'\n",[114,273,275],{"id":274},"mcp","MCP",[105,277,278,279,282,283,286],{},"Via the MCP server, call ",[146,280,281],{},"sandbox_execute"," with an ",[146,284,285],{},"operations[]"," array. This is the recommended path when an agent only needs to see a specific part of a high-resolution image.",[114,288,290],{"id":289},"best-practices-for-agents","Best practices for agents",[292,293,294,304,310],"ul",{},[295,296,297,300,301,303],"li",{},[109,298,299],{},"Crop first, send second."," If you only need one panel of a dashboard screenshot, ",[146,302,148],{}," to it before sending.",[295,305,306,309],{},[109,307,308],{},"Binarize for text."," OCR-style reads are far cheaper and more reliable on binarized images.",[295,311,312,315,316,319],{},[109,313,314],{},"Report ROI."," Use ",[146,317,318],{},"get_savings_stats"," to surface cumulative token\u002FUSD savings to the user.",[321,322,323],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":219,"searchDepth":226,"depth":247,"links":325},[326,327,328,329],{"id":116,"depth":247,"text":117},{"id":204,"depth":247,"text":24},{"id":274,"depth":247,"text":275},{"id":289,"depth":247,"text":290},"Run atomic image operations locally to extract only the context the LLM needs.","md",null,{},{"icon":93},{"title":90,"description":330},"8nyDlSaNU2GoxTjKvxfd_h_xq4NkHOC74u6xxT7x_kI",[338,340],{"title":85,"path":86,"stem":87,"description":339,"icon":88,"children":-1},"Use VisionSqueezer from Python via native pyo3 wheels.",{"title":95,"path":96,"stem":97,"description":341,"icon":98,"children":-1},"Automate token optimization for high-scale web scraping with Firecrawl, Crawl4AI, and Playwright.",1782053693556]