[{"data":1,"prerenderedAt":813},["ShallowReactive",2],{"/bitmap":3,"/bitmap-surround":802},{"id":4,"title":5,"body":6,"description":776,"extension":777,"meta":778,"navigation":795,"path":799,"seo":800,"stem":12,"__hash__":801},"content/bitmap.md","Bitmap Extension",{"type":7,"value":8,"toc":693},"minimark",[9,22,32,36,46,49,58,61,80,83,86,95,103,251,260,296,328,360,393,423,457,497,523,546,572,600,628,666],[10,11,15],"h1",{"id":12,"className":13},"bitmap",[14],"section-heading",[16,17,21],"a",{"className":18,"href":20},[19],"section-anchor","#bitmap","Bitmap",[23,24,27],"h2",{"id":25,"className":26},"using",[14],[16,28,31],{"className":29,"href":30},[19],"#using","Using",[33,34,35],"p",{},"The bitmap extension is pre-installed in NetLogo. For instructions on using it, or for more information about NetLogo extensions, see the NetLogo User Manual.",[37,38,41],"h3",{"id":39,"className":40},"what-does-the-bitmap-extension-do",[14],[16,42,45],{"className":43,"href":44},[19],"#what-does-the-bitmap-extension-do","What does the Bitmap Extension do?",[33,47,48],{},"The Bitmap Extension allows you to manipulate and import images into\nthe drawing and patches. It offers features not provided by the\nNetLogo core primitives, such as: scaling, manipulation of different\ncolor channels, and width and height reporters.",[37,50,53],{"id":51,"className":52},"getting-started",[14],[16,54,57],{"className":55,"href":56},[19],"#getting-started","Getting started",[33,59,60],{},"To import and manipulate images you will need to include the bitmap\nextension in your NetLogo model.",[62,63,64],"pre",{},[65,66,67,74,75,79],"code",{},[68,69,73],"span",{"className":70},[71,72],"token","keyword","extensions","[ ",[68,76,12],{"className":77},[71,78],"variable"," ]",[33,81,82],{},"The image file formats supported are determined by your Java virtual\nmachine’s imageio library. Typically this is PNG, JPG, GIF, and\nBMP. PNG is a good, standard choice that is likely to work\neverywhere.",[33,84,85],{},"If the image format supports transparency (alpha), that information\nwill be imported as well.",[23,87,90],{"id":88,"className":89},"primitives",[14],[16,91,94],{"className":92,"href":93},[19],"#primitives","Primitives",[33,96,97,98,102],{},"Looking for the primitive reference for the Bitmap extension? You can find ",[16,99,101],{"href":100},"/bitmap/dictionary","the full reference here",".",[104,105,109,110,117,118,123,124,117,131,123,134,117,141,123,144,117,151,123,154,117,161,123,164,117,171,123,174,117,181,123,184,117,191,123,194,117,201,123,204,117,211,123,214,117,221,123,224,117,231,123,234,117,241,123,244],"div",{"id":106,"className":107},"all",[108],"prose","\n  ",[16,111,114],{"className":112,"href":113},[65],"#average-color",[65,115,116],{},"bitmap:average-color","\n   ",[68,119,122],{"className":120},[121],"font-bold"," · "," \n  ",[16,125,128],{"className":126,"href":127},[65],"#channel",[65,129,130],{},"bitmap:channel",[68,132,122],{"className":133},[121],[16,135,138],{"className":136,"href":137},[65],"#copy-to-drawing",[65,139,140],{},"bitmap:copy-to-drawing",[68,142,122],{"className":143},[121],[16,145,148],{"className":146,"href":147},[65],"#copy-to-pcolors",[65,149,150],{},"bitmap:copy-to-pcolors",[68,152,122],{"className":153},[121],[16,155,158],{"className":156,"href":157},[65],"#difference-rgb",[65,159,160],{},"bitmap:difference-rgb",[68,162,122],{"className":163},[121],[16,165,168],{"className":166,"href":167},[65],"#export",[65,169,170],{},"bitmap:export",[68,172,122],{"className":173},[121],[16,175,178],{"className":176,"href":177},[65],"#from-base64",[65,179,180],{},"bitmap:from-base64",[68,182,122],{"className":183},[121],[16,185,188],{"className":186,"href":187},[65],"#to-base64",[65,189,190],{},"bitmap:to-base64",[68,192,122],{"className":193},[121],[16,195,198],{"className":196,"href":197},[65],"#from-view",[65,199,200],{},"bitmap:from-view",[68,202,122],{"className":203},[121],[16,205,208],{"className":206,"href":207},[65],"#to-grayscale",[65,209,210],{},"bitmap:to-grayscale",[68,212,122],{"className":213},[121],[16,215,218],{"className":216,"href":217},[65],"#height",[65,219,220],{},"bitmap:height",[68,222,122],{"className":223},[121],[16,225,228],{"className":226,"href":227},[65],"#import",[65,229,230],{},"bitmap:import",[68,232,122],{"className":233},[121],[16,235,238],{"className":236,"href":237},[65],"#scaled",[65,239,240],{},"bitmap:scaled",[68,242,122],{"className":243},[121],[16,245,248],{"className":246,"href":247},[65],"#width",[65,249,250],{},"bitmap:width",[37,252,255],{"id":253,"className":254},"all-primitives",[14],[16,256,259],{"className":257,"href":258},[19],"#all-primitives","All Primitives",[104,261,109,265,109,271,289],{"className":262,"id":264},[263],"dict_entry","average-color",[37,266,268,269,109],{"id":267},"bitmapaverage-color","\n    ",[16,270,116],{"href":113},[272,273,276],"h4",{"id":274,"className":275},"bitmapaverage-color-image",[14],[16,277,268,280,109],{"className":278,"href":279},[19],"#----bitmapaverage-color-image--",[68,281,284,285],{"className":282},[283],"prim_example","bitmap:average-color ",[286,287,288],"i",{},"image",[33,290,291,292,295],{},"Reports a 3-element list describing the amount of R, G, and B in\n",[293,294,288],"em",{},", by summing across all pixels, and normalizing each\ncomponent by the number of pixels in the image, so each component\nranges from 0 to 255.",[104,297,109,300,109,305,322],{"className":298,"id":299},[263],"channel",[37,301,268,303,109],{"id":302},"bitmapchannel",[16,304,130],{"href":127},[272,306,309],{"id":307,"className":308},"bitmapchannel-image-channel",[14],[16,310,268,313,109],{"className":311,"href":312},[19],"#----bitmapchannel-image-channel--",[68,314,316,317,319,320],{"className":315},[283],"bitmap:channel ",[286,318,288],{}," ",[286,321,299],{},[33,323,324,325,327],{},"Extracts either the alpha, red, green, or blue channel from an image.\nThe input ",[293,326,299],{}," should be an integer 0-3 indicating the\nchannel to remove (alpha=0, red=1, green=2, blue=3). The resulting\nimage is a grayscale image representing specified channel.",[104,329,109,332,109,337,357],{"className":330,"id":331},[263],"copy-to-drawing",[37,333,268,335,109],{"id":334},"bitmapcopy-to-drawing",[16,336,140],{"href":137},[272,338,341],{"id":339,"className":340},"bitmapcopy-to-drawing-image-x-y",[14],[16,342,268,345,109],{"className":343,"href":344},[19],"#----bitmapcopy-to-drawing-image-x-y--",[68,346,348,349,319,351,319,354],{"className":347},[283],"bitmap:copy-to-drawing ",[286,350,288],{},[286,352,353],{},"x",[286,355,356],{},"y",[33,358,359],{},"Imports the given image into the drawing without scaling the image at\nthe given pixel coordinates.",[104,361,109,364,109,369,386],{"className":362,"id":363},[263],"copy-to-pcolors",[37,365,268,367,109],{"id":366},"bitmapcopy-to-pcolors",[16,368,150],{"href":147},[272,370,373],{"id":371,"className":372},"bitmapcopy-to-pcolors-image-boolean",[14],[16,374,268,377,109],{"className":375,"href":376},[19],"#----bitmapcopy-to-pcolors-image-boolean--",[68,378,380,381,319,383],{"className":379},[283],"bitmap:copy-to-pcolors ",[286,382,288],{},[286,384,385],{},"boolean",[33,387,388,389,392],{},"Imports the given image into the pcolors, scaled to fit the world.\nThe second input indicates whether the colors should be interpreted\nas NetLogo colors or left as RGB colors. ",[65,390,391],{},"false"," means RGB\ncolors.",[104,394,109,397,109,402,420],{"className":395,"id":396},[263],"difference-rgb",[37,398,268,400,109],{"id":399},"bitmapdifference-rgb",[16,401,160],{"href":157},[272,403,406],{"id":404,"className":405},"bitmapdifference-rgb-image1-image2",[14],[16,407,268,410,109],{"className":408,"href":409},[19],"#----bitmapdifference-rgb-image1-image2--",[68,411,413,414,319,417],{"className":412},[283],"bitmap:difference-rgb ",[286,415,416],{},"image1",[286,418,419],{},"image2",[33,421,422],{},"Reports an image that is the absolute value of the pixel-wise RGB\ndifference between two images. Note that image1 and image2 MUST be\nthe same width and height as each other, or errors will ensue.",[104,424,109,427,109,432,449],{"className":425,"id":426},[263],"export",[37,428,268,430,109],{"id":429},"bitmapexport",[16,431,170],{"href":167},[272,433,436],{"id":434,"className":435},"bitmapexport-image-filename",[14],[16,437,268,440,109],{"className":438,"href":439},[19],"#----bitmapexport-image-filename--",[68,441,443,444,319,446],{"className":442},[283],"bitmap:export ",[286,445,288],{},[286,447,448],{},"filename",[33,450,451,452,454,455,102],{},"Writes ",[293,453,288],{}," to ",[293,456,448],{},[104,458,109,461,109,466,481],{"className":459,"id":460},[263],"from-base64",[37,462,268,464,109],{"id":463},"bitmapfrom-base64",[16,465,180],{"href":177},[272,467,470],{"id":468,"className":469},"bitmapfrom-base64-base64-string",[14],[16,471,268,474,109],{"className":472,"href":473},[19],"#----bitmapfrom-base64-base64-string--",[68,475,477,478],{"className":476},[283],"bitmap:from-base64 ",[286,479,480],{},"base64-string",[33,482,483,484,490,491,496],{},"Turns a base64 encoded string into a bitmap image for use by the extension.  The ",[16,485,489],{"href":486,"rel":487},"https://github.com/NetLogo/Fetch-Extension",[488],"nofollow","Fetch"," and ",[16,492,495],{"href":493,"rel":494},"https://github.com/NetLogo/ExportThe-Extension",[488],"Export-The"," extensions would be common sources of these encoded strings.",[104,498,109,501,109,506,520],{"className":499,"id":500},[263],"to-base64",[37,502,268,504,109],{"id":503},"bitmapto-base64",[16,505,190],{"href":187},[272,507,510],{"id":508,"className":509},"bitmapto-base64-base64-string",[14],[16,511,268,514,109],{"className":512,"href":513},[19],"#----bitmapto-base64-base64-string--",[68,515,517,518],{"className":516},[283],"bitmap:to-base64 ",[286,519,480],{},[33,521,522],{},"Turns a bitmap image into a base64 encoded string with a PNG format.",[104,524,109,527,109,532,543],{"className":525,"id":526},[263],"from-view",[37,528,268,530,109],{"id":529},"bitmapfrom-view",[16,531,200],{"href":197},[272,533,536],{"id":534,"className":535},"bitmapfrom-view-1",[14],[16,537,268,540,109],{"className":538,"href":539},[19],"#----bitmapfrom-view---1",[68,541,200],{"className":542},[283],[33,544,545],{},"Reports an image of the current view.",[104,547,109,550,109,555,569],{"className":548,"id":549},[263],"to-grayscale",[37,551,268,553,109],{"id":552},"bitmapto-grayscale",[16,554,210],{"href":207},[272,556,559],{"id":557,"className":558},"bitmapto-grayscale-image",[14],[16,560,268,563,109],{"className":561,"href":562},[19],"#----bitmapto-grayscale-image--",[68,564,566,567],{"className":565},[283],"bitmap:to-grayscale ",[286,568,288],{},[33,570,571],{},"Converts the given image to grayscale.",[104,573,109,576,109,581,595],{"className":574,"id":575},[263],"height",[37,577,268,579,109],{"id":578},"bitmapheight",[16,580,220],{"href":217},[272,582,585],{"id":583,"className":584},"bitmapheight-image",[14],[16,586,268,589,109],{"className":587,"href":588},[19],"#----bitmapheight-image--",[68,590,592,593],{"className":591},[283],"bitmap:height ",[286,594,288],{},[33,596,597,598],{},"Reports the height of given ",[293,599,288],{},[104,601,109,604,109,609,623],{"className":602,"id":603},[263],"import",[37,605,268,607,109],{"id":606},"bitmapimport",[16,608,230],{"href":227},[272,610,613],{"id":611,"className":612},"bitmapimport-filename",[14],[16,614,268,617,109],{"className":615,"href":616},[19],"#----bitmapimport-filename--",[68,618,620,621],{"className":619},[283],"bitmap:import ",[286,622,448],{},[33,624,625,626,102],{},"Reports a LogoBitmap containing the image at ",[293,627,448],{},[104,629,109,632,109,637,656],{"className":630,"id":631},[263],"scaled",[37,633,268,635,109],{"id":634},"bitmapscaled",[16,636,240],{"href":237},[272,638,641],{"id":639,"className":640},"bitmapscaled-image-width-height",[14],[16,642,268,645,109],{"className":643,"href":644},[19],"#----bitmapscaled-image-width-height--",[68,646,648,649,319,651,319,654],{"className":647},[283],"bitmap:scaled ",[286,650,288],{},[286,652,653],{},"width",[286,655,575],{},[33,657,658,659,661,662,490,664],{},"Reports a new image that is ",[293,660,288],{}," scaled to the given ",[293,663,653],{},[293,665,575],{},[104,667,109,669,109,674,688],{"className":668,"id":653},[263],[37,670,268,672,109],{"id":671},"bitmapwidth",[16,673,250],{"href":247},[272,675,678],{"id":676,"className":677},"bitmapwidth-image",[14],[16,679,268,682,109],{"className":680,"href":681},[19],"#----bitmapwidth-image--",[68,683,685,686],{"className":684},[283],"bitmap:width ",[286,687,288],{},[33,689,690,691],{},"Reports the width of the given ",[293,692,288],{},{"title":694,"searchDepth":695,"depth":696,"links":697},"",5,3,[698,703],{"id":25,"depth":699,"text":31,"children":700},2,[701,702],{"id":39,"depth":696,"text":45},{"id":51,"depth":696,"text":57},{"id":88,"depth":699,"text":94,"children":704},[705,706,712,717,722,727,732,737,742,747,751,756,761,766,771],{"id":253,"depth":696,"text":259},{"id":267,"depth":696,"text":707,"children":708},"\n    bitmap:average-color\n  ",[709],{"id":274,"depth":710,"text":711},4,"\n    bitmap:average-color image\n  ",{"id":302,"depth":696,"text":713,"children":714},"\n    bitmap:channel\n  ",[715],{"id":307,"depth":710,"text":716},"\n    bitmap:channel image channel\n  ",{"id":334,"depth":696,"text":718,"children":719},"\n    bitmap:copy-to-drawing\n  ",[720],{"id":339,"depth":710,"text":721},"\n    bitmap:copy-to-drawing image x y\n  ",{"id":366,"depth":696,"text":723,"children":724},"\n    bitmap:copy-to-pcolors\n  ",[725],{"id":371,"depth":710,"text":726},"\n    bitmap:copy-to-pcolors image boolean\n  ",{"id":399,"depth":696,"text":728,"children":729},"\n    bitmap:difference-rgb\n  ",[730],{"id":404,"depth":710,"text":731},"\n    bitmap:difference-rgb image1 image2\n  ",{"id":429,"depth":696,"text":733,"children":734},"\n    bitmap:export\n  ",[735],{"id":434,"depth":710,"text":736},"\n    bitmap:export image filename\n  ",{"id":463,"depth":696,"text":738,"children":739},"\n    bitmap:from-base64\n  ",[740],{"id":468,"depth":710,"text":741},"\n    bitmap:from-base64 base64-string\n  ",{"id":503,"depth":696,"text":743,"children":744},"\n    bitmap:to-base64\n  ",[745],{"id":508,"depth":710,"text":746},"\n    bitmap:to-base64 base64-string\n  ",{"id":529,"depth":696,"text":748,"children":749},"\n    bitmap:from-view\n  ",[750],{"id":534,"depth":710,"text":748},{"id":552,"depth":696,"text":752,"children":753},"\n    bitmap:to-grayscale\n  ",[754],{"id":557,"depth":710,"text":755},"\n    bitmap:to-grayscale image\n  ",{"id":578,"depth":696,"text":757,"children":758},"\n    bitmap:height\n  ",[759],{"id":583,"depth":710,"text":760},"\n    bitmap:height image\n  ",{"id":606,"depth":696,"text":762,"children":763},"\n    bitmap:import\n  ",[764],{"id":611,"depth":710,"text":765},"\n    bitmap:import filename\n  ",{"id":634,"depth":696,"text":767,"children":768},"\n    bitmap:scaled\n  ",[769],{"id":639,"depth":710,"text":770},"\n    bitmap:scaled image width height\n  ",{"id":671,"depth":696,"text":772,"children":773},"\n    bitmap:width\n  ",[774],{"id":676,"depth":710,"text":775},"\n    bitmap:width image\n  ","Documentation for the Bitmap extension.","md",{"source":779,"metadataOutputPath":780,"projectConfig":781,"language":788,"inheritFrom":796,"output":795,"version":782,"icon":797,"extensionName":798,"assetsRoot":783},"../../external/extensions/bitmap/bitmap.md","content/bitmap.metadata.yaml",{"version":782,"projectRoot":102,"scanRoot":783,"outputRoot":784,"defaults":785,"engine":791,"partials":792,"dedupeIdenticalDiskWrites":795},"7.0.4","/home/runner/work/Helio/Helio/external/extensions/bitmap","content",{"inheritFrom":786,"language":788,"output":789,"extension":777,"title":790,"version":782},[787],0,"en",false,"NetLogo User Manual","mustache",{"directoryPaths":793,"extensions":794},[102],[791,777],true,[787],"i-bi-filetype-bmp",{"shortName":12,"fullName":21},"/bitmap",{"title":5,"description":776},"y5wNwLry3XK6PDL4FhPr7fNnVFkT7ZkT6seZ4SNXKn8",[803,808],{"title":804,"path":805,"stem":806,"description":807},"Behavior Space","/behaviorspace","behaviorspace","BehaviorSpace is a software tool integrated with NetLogo that allows you to perform experiments with models.",{"title":809,"path":810,"stem":811,"description":812},"Bitmap Extension Dictionary: average-color","/bitmap/average-color","bitmap/average-color","Documentation for the average-color primitive.",1777657789571]