CINXE.COM
image package - image - Go Packages
<!DOCTYPE html> <html lang="en" data-layout="responsive" data-local=""> <head> <script> window.addEventListener('error', window.__err=function f(e){f.p=f.p||[];f.p.push(e)}); </script> <script> (function() { const theme = document.cookie.match(/prefers-color-scheme=(light|dark|auto)/)?.[1] if (theme) { document.querySelector('html').setAttribute('data-theme', theme); } }()) </script> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="Description" content="Package image implements a basic 2-D image library."> <meta class="js-gtmID" data-gtmid="GTM-W8MVQXG"> <link rel="shortcut icon" href="/static/shared/icon/favicon.ico"> <link rel="canonical" href="https://pkg.go.dev/image"> <link href="/static/frontend/frontend.min.css?version=prod-frontend-00098-h5t" rel="stylesheet"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Go Packages"> <title>image package - image - Go Packages</title> <link href="/static/frontend/unit/unit.min.css?version=prod-frontend-00098-h5t" rel="stylesheet"> <link href="/static/frontend/unit/main/main.min.css?version=prod-frontend-00098-h5t" rel="stylesheet"> </head> <body> <script> function loadScript(src, mod = true) { let s = document.createElement('script'); s.src = src; if (mod) { s.type = 'module'; s.async = true; s.defer = true } document.head.appendChild(s); } loadScript("/third_party/dialog-polyfill/dialog-polyfill.js", false) loadScript("/static/frontend/frontend.js"); </script> <header class="go-Header go-Header--full js-siteHeader"> <div class="go-Header-inner go-Header-inner--dark"> <nav class="go-Header-nav"> <a href="https://go.dev/" class="js-headerLogo" data-gtmc="nav link" data-test-id="go-header-logo-link" role="heading" aria-level="1"> <img class="go-Header-logo" src="/static/shared/logo/go-white.svg" alt="Go"> </a> <div class="skip-navigation-wrapper"> <a class="skip-to-content-link" aria-label="Skip to main content" href="#main-content"> Skip to Main Content </a> </div> <div class="go-Header-rightContent"> <div class="go-SearchForm js-searchForm"> <form class="go-InputGroup go-ShortcutKey go-SearchForm-form" action="/search" data-shortcut="/" data-shortcut-alt="search" data-gtmc="search form" aria-label="Search for a package" role="search" > <input name="q" class="go-Input js-searchFocus" aria-label="Search for a package" type="search" autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" placeholder="Search packages or symbols" value="" /> <input name="m" value="" hidden> <button class="go-Button go-Button--inverted" aria-label="Submit search"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/search_gm_grey_24dp.svg" alt="" /> </button> </form> <button class="go-SearchForm-expandSearch js-expandSearch" data-gtmc="nav button" aria-label="Open search" data-test-id="expand-search"> <img class="go-Icon go-Icon--inverted" height="24" width="24" src="/static/shared/icon/search_gm_grey_24dp.svg" alt=""> </button> </div> <ul class="go-Header-menu"> <li class="go-Header-menuItem"> <a class="js-desktop-menu-hover" href="#" data-gtmc="nav link"> Why Go <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_drop_down_gm_grey_24dp.svg" alt="submenu dropdown icon"> </a> <ul class="go-Header-submenu go-Header-submenu--why js-desktop-submenu-hover" aria-label="submenu"> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/solutions#case-studies"> <span>Case Studies</span> </a> </div> <p>Common problems companies solve with Go</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/solutions#use-cases"> <span>Use Cases</span> </a> </div> <p>Stories about how and why companies use Go</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/security/"> <span>Security</span> </a> </div> <p>How Go can help keep you secure by default</p> </li> </ul> </li> <li class="go-Header-menuItem"> <a href="https://go.dev/learn/" data-gtmc="nav link">Learn</a> </li> <li class="go-Header-menuItem"> <a class="js-desktop-menu-hover" href="#" data-gtmc="nav link"> Docs <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_drop_down_gm_grey_24dp.svg" alt="submenu dropdown icon"> </a> <ul class="go-Header-submenu go-Header-submenu--docs js-desktop-submenu-hover" aria-label="submenu"> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/doc/effective_go"> <span>Effective Go</span> </a> </div> <p>Tips for writing clear, performant, and idiomatic Go code</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/doc/"> <span>Go User Manual</span> </a> </div> <p>A complete introduction to building software with Go</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://pkg.go.dev/std"> <span>Standard library</span> </a> </div> <p>Reference documentation for Go's standard library</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/doc/devel/release"> <span>Release Notes</span> </a> </div> <p>Learn what's new in each Go release</p> </li> </ul> </li> <li class="go-Header-menuItem go-Header-menuItem--active"> <a href="/" data-gtmc="nav link">Packages</a> </li> <li class="go-Header-menuItem"> <a class="js-desktop-menu-hover" href="#" data-gtmc="nav link"> Community <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_drop_down_gm_grey_24dp.svg" alt="submenu dropdown icon"> </a> <ul class="go-Header-submenu go-Header-submenu--community js-desktop-submenu-hover" aria-label="submenu"> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/talks/"> <span>Recorded Talks</span> </a> </div> <p>Videos from prior events</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://www.meetup.com/pro/go"> <span>Meetups</span> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""> </i> </a> </div> <p>Meet other local Go developers</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://github.com/golang/go/wiki/Conferences"> <span>Conferences</span> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""> </i> </a> </div> <p>Learn and network with Go developers from around the world</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/blog"> <span>Go blog</span> </a> </div> <p>The Go project's official blog.</p> </li> <li class="go-Header-submenuItem"> <div> <a href="https://go.dev/help"> <span>Go project</span> </a> </div> <p>Get help and stay informed from Go</p> </li> <li class="go-Header-submenuItem"> <div> Get connected </div> <p></p> <div class="go-Header-socialIcons"> <a class="go-Header-socialIcon" aria-label="Get connected with google-groups (Opens in new window)" title="Get connected with google-groups (Opens in new window)" href="https://groups.google.com/g/golang-nuts"> <img src="/static/shared/logo/social/google-groups.svg" /> </a> <a class="go-Header-socialIcon" aria-label="Get connected with github (Opens in new window)" title="Get connected with github (Opens in new window)" href="https://github.com/golang"> <img src="/static/shared/logo/social/github.svg" /> </a> <a class="go-Header-socialIcon" aria-label="Get connected with twitter (Opens in new window)" title="Get connected with twitter (Opens in new window)" href="https://twitter.com/golang"> <img src="/static/shared/logo/social/twitter.svg" /> </a> <a class="go-Header-socialIcon" aria-label="Get connected with reddit (Opens in new window)" title="Get connected with reddit (Opens in new window)" href="https://www.reddit.com/r/golang/"> <img src="/static/shared/logo/social/reddit.svg" /> </a> <a class="go-Header-socialIcon" aria-label="Get connected with slack (Opens in new window)" title="Get connected with slack (Opens in new window)" href="https://invite.slack.golangbridge.org/"> <img src="/static/shared/logo/social/slack.svg" /> </a> <a class="go-Header-socialIcon" aria-label="Get connected with stack-overflow (Opens in new window)" title="" href="https://stackoverflow.com/collectives/go"> <img src="/static/shared/logo/social/stack-overflow.svg" /> </a> </div> </li> </ul> </li> </ul> <button class="go-Header-navOpen js-headerMenuButton go-Header-navOpen--white" data-gtmc="nav button" aria-label="Open navigation"> </button> </div> </nav> </div> </header> <aside class="go-NavigationDrawer js-header"> <nav class="go-NavigationDrawer-nav"> <div class="go-NavigationDrawer-header"> <a href="https://go.dev/"> <img class="go-NavigationDrawer-logo" src="/static/shared/logo/go-blue.svg" alt="Go."> </a> </div> <ul class="go-NavigationDrawer-list"> <li class="go-NavigationDrawer-listItem js-mobile-subnav-trigger go-NavigationDrawer-hasSubnav"> <a href="#"> <span>Why Go</span> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/navigate_next_gm_grey_24dp.svg" alt=""> </i> </a> <div class="go-NavigationDrawer go-NavigationDrawer-submenuItem"> <div class="go-NavigationDrawer-nav"> <div class="go-NavigationDrawer-header"> <a href="#"> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/navigate_before_gm_grey_24dp.svg" alt=""> </i> Why Go </a> </div> <ul class="go-NavigationDrawer-list"> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/solutions#case-studies"> Case Studies </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/solutions#use-cases"> Use Cases </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/security/"> Security </a> </li> </ul> </div> </div> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/learn/">Learn</a> </li> <li class="go-NavigationDrawer-listItem js-mobile-subnav-trigger go-NavigationDrawer-hasSubnav"> <a href="#"> <span>Docs</span> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/navigate_next_gm_grey_24dp.svg" alt=""> </i> </a> <div class="go-NavigationDrawer go-NavigationDrawer-submenuItem"> <div class="go-NavigationDrawer-nav"> <div class="go-NavigationDrawer-header"> <a href="#"><i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/navigate_before_gm_grey_24dp.svg" alt=""> </i> Docs </a> </div> <ul class="go-NavigationDrawer-list"> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/doc/effective_go"> Effective Go </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/doc/"> Go User Manual </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://pkg.go.dev/std"> Standard library </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/doc/devel/release"> Release Notes </a> </li> </ul> </div> </div> </li> <li class="go-NavigationDrawer-listItem go-NavigationDrawer-listItem--active"> <a href="/">Packages</a> </li> <li class="go-NavigationDrawer-listItem js-mobile-subnav-trigger go-NavigationDrawer-hasSubnav"> <a href="#"> <span>Community</span> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/navigate_next_gm_grey_24dp.svg" alt=""> </i> </a> <div class="go-NavigationDrawer go-NavigationDrawer-submenuItem"> <div class="go-NavigationDrawer-nav"> <div class="go-NavigationDrawer-header"> <a href="#"> <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/navigate_before_gm_grey_24dp.svg" alt=""> </i> Community </a> </div> <ul class="go-NavigationDrawer-list"> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/talks/"> Recorded Talks </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://www.meetup.com/pro/go"> Meetups <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""> </i> </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://github.com/golang/go/wiki/Conferences"> Conferences <i class="material-icons"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""> </i> </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/blog"> Go blog </a> </li> <li class="go-NavigationDrawer-listItem"> <a href="https://go.dev/help"> Go project </a> </li> <li class="go-NavigationDrawer-listItem"> <div>Get connected</div> <div class="go-Header-socialIcons"> <a class="go-Header-socialIcon" href="https://groups.google.com/g/golang-nuts"><img src="/static/shared/logo/social/google-groups.svg" /></a> <a class="go-Header-socialIcon" href="https://github.com/golang"><img src="/static/shared/logo/social/github.svg" /></a> <a class="go-Header-socialIcon" href="https://twitter.com/golang"><img src="/static/shared/logo/social/twitter.svg" /></a> <a class="go-Header-socialIcon" href="https://www.reddit.com/r/golang/"><img src="/static/shared/logo/social/reddit.svg" /></a> <a class="go-Header-socialIcon" href="https://invite.slack.golangbridge.org/"><img src="/static/shared/logo/social/slack.svg" /></a> <a class="go-Header-socialIcon" href="https://stackoverflow.com/collectives/go"><img src="/static/shared/logo/social/stack-overflow.svg" /></a> </div> </li> </ul> </div> </div> </li> </ul> </nav> </aside> <div class="go-NavigationDrawer-scrim js-scrim" role="presentation"></div> <main class="go-Main" id="main-content"> <div class="go-Main-banner" role="alert"></div> <header class="go-Main-header js-mainHeader"> <nav class="go-Main-headerBreadcrumb go-Breadcrumb" aria-label="Breadcrumb" data-test-id="UnitHeader-breadcrumb"> <ol> <li data-test-id="UnitHeader-breadcrumbItem"> <a href="/" data-gtmc="breadcrumb link">Discover Packages</a> </li> <li data-test-id="UnitHeader-breadcrumbItem"> <a href="/std" data-gtmc="breadcrumb link">Standard library</a> </li> <li> <a href="/image@go1.24.2" data-gtmc="breadcrumb link" aria-current="location" data-test-id="UnitHeader-breadcrumbCurrent"> image </a> <button class="go-Button go-Button--inline go-Clipboard js-clipboard" title="Copy path to clipboard. image" aria-label="Copy Path to Clipboard" data-to-copy="image" data-gtmc="breadcrumbs button" > <img class="go-Icon go-Icon--accented" height="24" width="24" src="/static/shared/icon/content_copy_gm_grey_24dp.svg" alt="" > </button> </li> </ol> </nav> <div class="go-Main-headerContent"> <div class="go-Main-headerTitle js-stickyHeader"> <a class="go-Main-headerLogo" href="https://go.dev/" aria-hidden="true" tabindex="-1" data-gtmc="header link" aria-label="Link to Go Homepage"> <img height="78" width="207" src="/static/shared/logo/go-blue.svg" alt="Go"> </a> <h1 class="UnitHeader-titleHeading" data-test-id="UnitHeader-title">image</h1> <span class="go-Chip go-Chip--inverted">package</span> <span class="go-Chip go-Chip--inverted">standard library</span> <button class="go-Button go-Button--inline go-Clipboard js-clipboard" title="Copy path to clipboard. image" aria-label="Copy Path to Clipboard" data-to-copy="image" data-gtmc="title button" tabindex="-1" > <img class="go-Icon go-Icon--accented" height="24" width="24" src="/static/shared/icon/content_copy_gm_grey_24dp.svg" alt="" /> </button> </div> <div class="go-Main-headerDetails"> <span class="go-Main-headerDetailItem" data-test-id="UnitHeader-version"> <a href="?tab=versions" aria-label="Version: go1.24.2" data-gtmc="header link" aria-describedby="version-description"> <span class="go-textSubtle" aria-hidden="true">Version: </span> go1.24.2 </a> <div class="screen-reader-only" id="version-description" hidden> Opens a new window with list of versions in this module. </div> <span class="DetailsHeader-badge--latest" data-test-id="UnitHeader-minorVersionBanner"> <span class="go-Chip DetailsHeader-span--latest">Latest</span> <span class="go-Chip DetailsHeader-span--notAtLatest"> Latest <details class="go-Tooltip js-tooltip" data-gtmc="tooltip"> <summary> <img class="go-Icon go-Icon--inverted" height="24" width="24" src="/static/shared/icon/alert_gm_grey_24dp.svg" alt="Warning"> </summary> <p>This package is not in the latest version of its module.</p> </details> </span> <a href="/image" aria-label="Go to Latest Version" data-gtmc="header link"> <span class="go-Chip go-Chip--alert DetailsHeader-span--goToLatest">Go to latest</span> </a> </span> </span> <span class="go-Main-headerDetailItem" data-test-id="UnitHeader-commitTime"> Published: Apr 1, 2025 </span> <span class="go-Main-headerDetailItem" data-test-id="UnitHeader-licenses"> License: <a href="/image?tab=licenses" data-test-id="UnitHeader-license" data-gtmc="header link" aria-describedby="license-description">BSD-3-Clause</a> </span> <div class="screen-reader-only" id="license-description" hidden> Opens a new window with license information. </div> <span class="go-Main-headerDetailItem" data-test-id="UnitHeader-imports"> <a href="/image?tab=imports" aria-label="Imports: 8" data-gtmc="header link" aria-describedby="imports-description"> <span class="go-textSubtle">Imports: </span>8 </a> </span> <div class="screen-reader-only" id="imports-description" hidden> Opens a new window with list of imports. </div> <span class="go-Main-headerDetailItem" data-test-id="UnitHeader-importedby"> <a href="/image?tab=importedby" aria-label="Imported By: 52,298" data-gtmc="header link" aria-describedby="importedby-description"> <span class="go-textSubtle">Imported by: </span>52,298 </a> </span> <div class="screen-reader-only" id="importedby-description" hidden> Opens a new window with list of known importers. </div> </div> <div class="UnitHeader-overflowContainer"> <svg class="UnitHeader-overflowImage" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"> <path d="M0 0h24v24H0z" fill="none"/> <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/> </svg> <select class="UnitHeader-overflowSelect js-selectNav" tabindex="-1"> <option value="/">Main</option> <option value="/image?tab=versions"> Versions </option> <option value="/image?tab=licenses"> Licenses </option> <option value="/image?tab=imports"> Imports </option> <option value="/image?tab=importedby"> Imported By </option> </select> </div> </div> </header> <aside class="go-Main-aside js-mainAside"> <div class="UnitMeta"> <h2 class="go-textLabel">Details</h2> <ul class="UnitMeta-details"> <li> <details class="go-Tooltip js-tooltip" data-gtmc="tooltip"> <summary class="go-textSubtle"> <img class="go-Icon go-Icon--accented" tabindex="0" role="button"src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked" aria-label="Valid file, toggle tooltip"height="24" width="24"> Valid <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/go.mod" target="_blank" rel="noopener">go.mod</a> file <img class="go-Icon" role="button" tabindex="0" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" aria-label="Toggle go.mod validity tooltip" height="24" width="24"> </summary> <p aria-live="polite" role="tooltip"> The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go. </p> </details> </li> <li> <details class="go-Tooltip js-tooltip" data-gtmc="tooltip"> <summary class="go-textSubtle"> <img class="go-Icon go-Icon--accented" tabindex="0" role="button"src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked" aria-label="Valid file, toggle tooltip"height="24" width="24"> Redistributable license <img class="go-Icon" role="button" tabindex="0" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" aria-label="Toggle redistributable help tooltip" height="24" width="24"> </summary> <p aria-live="polite" role="tooltip"> Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed. </p> </details> </li> <li> <details class="go-Tooltip js-tooltip" data-gtmc="tooltip"> <summary class="go-textSubtle"> <img class="go-Icon go-Icon--accented" tabindex="0" role="button"src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked" aria-label="Valid file, toggle tooltip"height="24" width="24"> Tagged version <img class="go-Icon" role="button" tabindex="0" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" aria-label="Toggle tagged version tooltip" height="24" width="24"> </summary> <p aria-live="polite" role="tooltip">Modules with tagged versions give importers more predictable builds.</p> </details> </li> <li> <details class="go-Tooltip js-tooltip" data-gtmc="tooltip"> <summary class="go-textSubtle"> <img class="go-Icon go-Icon--accented" tabindex="0" role="button"src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked" aria-label="Valid file, toggle tooltip"height="24" width="24"> Stable version <img class="go-Icon" role="button" tabindex="0" aria-label="Toggle stable version tooltip" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24"> </summary> <p aria-live="polite" role="tooltip">When a project reaches major version v1 it is considered stable.</p> </details> </li> <li class="UnitMeta-detailsLearn"> <a href="/about#best-practices" data-gtmc="meta link">Learn more about best practices</a> </li> </ul> <h2 class="go-textLabel">Repository</h2> <div class="UnitMeta-repo"> <a href="https://cs.opensource.google/go/go" title="https://cs.opensource.google/go/go" target="_blank" rel="noopener"> cs.opensource.google/go/go </a> </div> <h2 class="go-textLabel" data-test-id="links-heading">Links</h2> <ul class="UnitMeta-links"> <li> <a href="https://go.dev/security/policy" title="Report security issues in the Go standard library and sub-repositories"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/security_grey_24dp.svg" alt=""> Report a Vulnerability </a> </li> </ul> </div> </aside> <nav class="go-Main-nav go-Main-nav--sticky js-mainNav" aria-label="Outline"> <div class="go-Main-navDesktop"> <div class="UnitOutline-jumpTo"> <button class="UnitOutline-jumpToInput go-ShortcutKey js-jumpToInput" aria-controls="jump-to-modal" aria-label="Open Jump to Identifier" data-shortcut="f" data-shortcut-alt="find" data-test-id="jump-to-button" data-gtmc="outline button"> Jump to ... </button> </div> <ul class="go-Tree js-tree" role="tree" aria-label="Outline"> <li> <a href="#section-documentation" data-gtmc="outline link"> Documentation </a> <ul> <li> <a href="#pkg-overview" data-gtmc="doc outline link">Overview</a> </li> <li class="DocNav-overview"> <a href="#pkg-index" data-gtmc="doc outline link"> Index </a> <ul> <li> <a href="#pkg-examples" data-gtmc="doc outline link"> Examples </a> </li> </ul> </li> <li class="DocNav-constants"> <a href="#pkg-constants" data-gtmc="doc outline link"> Constants </a> </li> <li class="DocNav-variables"> <a href="#pkg-variables" data-gtmc="doc outline link"> Variables </a> </li> <li class="DocNav-functions"> <a href="#pkg-functions" data-gtmc="doc outline link"> Functions </a> <ul> <li> <a href="#RegisterFormat" title="RegisterFormat(name, magic, decode, decodeConfig)" data-gtmc="doc outline link"> RegisterFormat(name, magic, decode, decodeConfig) </a> </li> </ul> </li> <li class="DocNav-types"> <a href="#pkg-types" data-gtmc="doc outline link"> Types </a> <ul> <li> <a href="#Alpha" title="type Alpha" data-gtmc="doc outline link"> type Alpha </a> <ul> <li> <a href="#NewAlpha" title="NewAlpha(r)" data-gtmc="doc outline link"> NewAlpha(r) </a> </li> <li> <a href="#Alpha.AlphaAt" title="(p) AlphaAt(x, y)" data-gtmc="doc outline link"> (p) AlphaAt(x, y) </a> </li> <li> <a href="#Alpha.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#Alpha.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#Alpha.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#Alpha.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#Alpha.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#Alpha.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#Alpha.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#Alpha.SetAlpha" title="(p) SetAlpha(x, y, c)" data-gtmc="doc outline link"> (p) SetAlpha(x, y, c) </a> </li> <li> <a href="#Alpha.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#Alpha.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#Alpha16" title="type Alpha16" data-gtmc="doc outline link"> type Alpha16 </a> <ul> <li> <a href="#NewAlpha16" title="NewAlpha16(r)" data-gtmc="doc outline link"> NewAlpha16(r) </a> </li> <li> <a href="#Alpha16.Alpha16At" title="(p) Alpha16At(x, y)" data-gtmc="doc outline link"> (p) Alpha16At(x, y) </a> </li> <li> <a href="#Alpha16.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#Alpha16.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#Alpha16.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#Alpha16.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#Alpha16.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#Alpha16.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#Alpha16.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#Alpha16.SetAlpha16" title="(p) SetAlpha16(x, y, c)" data-gtmc="doc outline link"> (p) SetAlpha16(x, y, c) </a> </li> <li> <a href="#Alpha16.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#Alpha16.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#CMYK" title="type CMYK" data-gtmc="doc outline link"> type CMYK </a> <ul> <li> <a href="#NewCMYK" title="NewCMYK(r)" data-gtmc="doc outline link"> NewCMYK(r) </a> </li> <li> <a href="#CMYK.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#CMYK.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#CMYK.CMYKAt" title="(p) CMYKAt(x, y)" data-gtmc="doc outline link"> (p) CMYKAt(x, y) </a> </li> <li> <a href="#CMYK.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#CMYK.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#CMYK.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#CMYK.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#CMYK.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#CMYK.SetCMYK" title="(p) SetCMYK(x, y, c)" data-gtmc="doc outline link"> (p) SetCMYK(x, y, c) </a> </li> <li> <a href="#CMYK.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#CMYK.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#Config" title="type Config" data-gtmc="doc outline link"> type Config </a> <ul> <li> <a href="#DecodeConfig" title="DecodeConfig(r)" data-gtmc="doc outline link"> DecodeConfig(r) </a> </li> </ul> </li> <li> <a href="#Gray" title="type Gray" data-gtmc="doc outline link"> type Gray </a> <ul> <li> <a href="#NewGray" title="NewGray(r)" data-gtmc="doc outline link"> NewGray(r) </a> </li> <li> <a href="#Gray.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#Gray.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#Gray.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#Gray.GrayAt" title="(p) GrayAt(x, y)" data-gtmc="doc outline link"> (p) GrayAt(x, y) </a> </li> <li> <a href="#Gray.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#Gray.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#Gray.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#Gray.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#Gray.SetGray" title="(p) SetGray(x, y, c)" data-gtmc="doc outline link"> (p) SetGray(x, y, c) </a> </li> <li> <a href="#Gray.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#Gray.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#Gray16" title="type Gray16" data-gtmc="doc outline link"> type Gray16 </a> <ul> <li> <a href="#NewGray16" title="NewGray16(r)" data-gtmc="doc outline link"> NewGray16(r) </a> </li> <li> <a href="#Gray16.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#Gray16.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#Gray16.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#Gray16.Gray16At" title="(p) Gray16At(x, y)" data-gtmc="doc outline link"> (p) Gray16At(x, y) </a> </li> <li> <a href="#Gray16.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#Gray16.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#Gray16.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#Gray16.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#Gray16.SetGray16" title="(p) SetGray16(x, y, c)" data-gtmc="doc outline link"> (p) SetGray16(x, y, c) </a> </li> <li> <a href="#Gray16.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#Gray16.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#Image" title="type Image" data-gtmc="doc outline link"> type Image </a> <ul> <li> <a href="#Decode" title="Decode(r)" data-gtmc="doc outline link"> Decode(r) </a> </li> </ul> </li> <li> <a href="#NRGBA" title="type NRGBA" data-gtmc="doc outline link"> type NRGBA </a> <ul> <li> <a href="#NewNRGBA" title="NewNRGBA(r)" data-gtmc="doc outline link"> NewNRGBA(r) </a> </li> <li> <a href="#NRGBA.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#NRGBA.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#NRGBA.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#NRGBA.NRGBAAt" title="(p) NRGBAAt(x, y)" data-gtmc="doc outline link"> (p) NRGBAAt(x, y) </a> </li> <li> <a href="#NRGBA.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#NRGBA.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#NRGBA.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#NRGBA.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#NRGBA.SetNRGBA" title="(p) SetNRGBA(x, y, c)" data-gtmc="doc outline link"> (p) SetNRGBA(x, y, c) </a> </li> <li> <a href="#NRGBA.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#NRGBA.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#NRGBA64" title="type NRGBA64" data-gtmc="doc outline link"> type NRGBA64 </a> <ul> <li> <a href="#NewNRGBA64" title="NewNRGBA64(r)" data-gtmc="doc outline link"> NewNRGBA64(r) </a> </li> <li> <a href="#NRGBA64.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#NRGBA64.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#NRGBA64.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#NRGBA64.NRGBA64At" title="(p) NRGBA64At(x, y)" data-gtmc="doc outline link"> (p) NRGBA64At(x, y) </a> </li> <li> <a href="#NRGBA64.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#NRGBA64.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#NRGBA64.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#NRGBA64.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#NRGBA64.SetNRGBA64" title="(p) SetNRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetNRGBA64(x, y, c) </a> </li> <li> <a href="#NRGBA64.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#NRGBA64.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#NYCbCrA" title="type NYCbCrA" data-gtmc="doc outline link"> type NYCbCrA </a> <ul> <li> <a href="#NewNYCbCrA" title="NewNYCbCrA(r, subsampleRatio)" data-gtmc="doc outline link"> NewNYCbCrA(r, subsampleRatio) </a> </li> <li> <a href="#NYCbCrA.AOffset" title="(p) AOffset(x, y)" data-gtmc="doc outline link"> (p) AOffset(x, y) </a> </li> <li> <a href="#NYCbCrA.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#NYCbCrA.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#NYCbCrA.NYCbCrAAt" title="(p) NYCbCrAAt(x, y)" data-gtmc="doc outline link"> (p) NYCbCrAAt(x, y) </a> </li> <li> <a href="#NYCbCrA.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#NYCbCrA.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#NYCbCrA.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#Paletted" title="type Paletted" data-gtmc="doc outline link"> type Paletted </a> <ul> <li> <a href="#NewPaletted" title="NewPaletted(r, p)" data-gtmc="doc outline link"> NewPaletted(r, p) </a> </li> <li> <a href="#Paletted.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#Paletted.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#Paletted.ColorIndexAt" title="(p) ColorIndexAt(x, y)" data-gtmc="doc outline link"> (p) ColorIndexAt(x, y) </a> </li> <li> <a href="#Paletted.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#Paletted.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#Paletted.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#Paletted.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#Paletted.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#Paletted.SetColorIndex" title="(p) SetColorIndex(x, y, index)" data-gtmc="doc outline link"> (p) SetColorIndex(x, y, index) </a> </li> <li> <a href="#Paletted.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#Paletted.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#PalettedImage" title="type PalettedImage" data-gtmc="doc outline link"> type PalettedImage </a> </li> <li> <a href="#Point" title="type Point" data-gtmc="doc outline link"> type Point </a> <ul> <li> <a href="#Pt" title="Pt(X, Y)" data-gtmc="doc outline link"> Pt(X, Y) </a> </li> <li> <a href="#Point.Add" title="(p) Add(q)" data-gtmc="doc outline link"> (p) Add(q) </a> </li> <li> <a href="#Point.Div" title="(p) Div(k)" data-gtmc="doc outline link"> (p) Div(k) </a> </li> <li> <a href="#Point.Eq" title="(p) Eq(q)" data-gtmc="doc outline link"> (p) Eq(q) </a> </li> <li> <a href="#Point.In" title="(p) In(r)" data-gtmc="doc outline link"> (p) In(r) </a> </li> <li> <a href="#Point.Mod" title="(p) Mod(r)" data-gtmc="doc outline link"> (p) Mod(r) </a> </li> <li> <a href="#Point.Mul" title="(p) Mul(k)" data-gtmc="doc outline link"> (p) Mul(k) </a> </li> <li> <a href="#Point.String" title="(p) String()" data-gtmc="doc outline link"> (p) String() </a> </li> <li> <a href="#Point.Sub" title="(p) Sub(q)" data-gtmc="doc outline link"> (p) Sub(q) </a> </li> </ul> </li> <li> <a href="#RGBA" title="type RGBA" data-gtmc="doc outline link"> type RGBA </a> <ul> <li> <a href="#NewRGBA" title="NewRGBA(r)" data-gtmc="doc outline link"> NewRGBA(r) </a> </li> <li> <a href="#RGBA.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#RGBA.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#RGBA.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#RGBA.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#RGBA.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#RGBA.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#RGBA.RGBAAt" title="(p) RGBAAt(x, y)" data-gtmc="doc outline link"> (p) RGBAAt(x, y) </a> </li> <li> <a href="#RGBA.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#RGBA.SetRGBA" title="(p) SetRGBA(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA(x, y, c) </a> </li> <li> <a href="#RGBA.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#RGBA.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#RGBA64" title="type RGBA64" data-gtmc="doc outline link"> type RGBA64 </a> <ul> <li> <a href="#NewRGBA64" title="NewRGBA64(r)" data-gtmc="doc outline link"> NewRGBA64(r) </a> </li> <li> <a href="#RGBA64.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#RGBA64.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#RGBA64.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#RGBA64.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#RGBA64.PixOffset" title="(p) PixOffset(x, y)" data-gtmc="doc outline link"> (p) PixOffset(x, y) </a> </li> <li> <a href="#RGBA64.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#RGBA64.Set" title="(p) Set(x, y, c)" data-gtmc="doc outline link"> (p) Set(x, y, c) </a> </li> <li> <a href="#RGBA64.SetRGBA64" title="(p) SetRGBA64(x, y, c)" data-gtmc="doc outline link"> (p) SetRGBA64(x, y, c) </a> </li> <li> <a href="#RGBA64.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> </ul> </li> <li> <a href="#RGBA64Image" title="type RGBA64Image" data-gtmc="doc outline link"> type RGBA64Image </a> </li> <li> <a href="#Rectangle" title="type Rectangle" data-gtmc="doc outline link"> type Rectangle </a> <ul> <li> <a href="#Rect" title="Rect(x0, y0, x1, y1)" data-gtmc="doc outline link"> Rect(x0, y0, x1, y1) </a> </li> <li> <a href="#Rectangle.Add" title="(r) Add(p)" data-gtmc="doc outline link"> (r) Add(p) </a> </li> <li> <a href="#Rectangle.At" title="(r) At(x, y)" data-gtmc="doc outline link"> (r) At(x, y) </a> </li> <li> <a href="#Rectangle.Bounds" title="(r) Bounds()" data-gtmc="doc outline link"> (r) Bounds() </a> </li> <li> <a href="#Rectangle.Canon" title="(r) Canon()" data-gtmc="doc outline link"> (r) Canon() </a> </li> <li> <a href="#Rectangle.ColorModel" title="(r) ColorModel()" data-gtmc="doc outline link"> (r) ColorModel() </a> </li> <li> <a href="#Rectangle.Dx" title="(r) Dx()" data-gtmc="doc outline link"> (r) Dx() </a> </li> <li> <a href="#Rectangle.Dy" title="(r) Dy()" data-gtmc="doc outline link"> (r) Dy() </a> </li> <li> <a href="#Rectangle.Empty" title="(r) Empty()" data-gtmc="doc outline link"> (r) Empty() </a> </li> <li> <a href="#Rectangle.Eq" title="(r) Eq(s)" data-gtmc="doc outline link"> (r) Eq(s) </a> </li> <li> <a href="#Rectangle.In" title="(r) In(s)" data-gtmc="doc outline link"> (r) In(s) </a> </li> <li> <a href="#Rectangle.Inset" title="(r) Inset(n)" data-gtmc="doc outline link"> (r) Inset(n) </a> </li> <li> <a href="#Rectangle.Intersect" title="(r) Intersect(s)" data-gtmc="doc outline link"> (r) Intersect(s) </a> </li> <li> <a href="#Rectangle.Overlaps" title="(r) Overlaps(s)" data-gtmc="doc outline link"> (r) Overlaps(s) </a> </li> <li> <a href="#Rectangle.RGBA64At" title="(r) RGBA64At(x, y)" data-gtmc="doc outline link"> (r) RGBA64At(x, y) </a> </li> <li> <a href="#Rectangle.Size" title="(r) Size()" data-gtmc="doc outline link"> (r) Size() </a> </li> <li> <a href="#Rectangle.String" title="(r) String()" data-gtmc="doc outline link"> (r) String() </a> </li> <li> <a href="#Rectangle.Sub" title="(r) Sub(p)" data-gtmc="doc outline link"> (r) Sub(p) </a> </li> <li> <a href="#Rectangle.Union" title="(r) Union(s)" data-gtmc="doc outline link"> (r) Union(s) </a> </li> </ul> </li> <li> <a href="#Uniform" title="type Uniform" data-gtmc="doc outline link"> type Uniform </a> <ul> <li> <a href="#NewUniform" title="NewUniform(c)" data-gtmc="doc outline link"> NewUniform(c) </a> </li> <li> <a href="#Uniform.At" title="(c) At(x, y)" data-gtmc="doc outline link"> (c) At(x, y) </a> </li> <li> <a href="#Uniform.Bounds" title="(c) Bounds()" data-gtmc="doc outline link"> (c) Bounds() </a> </li> <li> <a href="#Uniform.ColorModel" title="(c) ColorModel()" data-gtmc="doc outline link"> (c) ColorModel() </a> </li> <li> <a href="#Uniform.Convert" title="(c) Convert()" data-gtmc="doc outline link"> (c) Convert() </a> </li> <li> <a href="#Uniform.Opaque" title="(c) Opaque()" data-gtmc="doc outline link"> (c) Opaque() </a> </li> <li> <a href="#Uniform.RGBA" title="(c) RGBA()" data-gtmc="doc outline link"> (c) RGBA() </a> </li> <li> <a href="#Uniform.RGBA64At" title="(c) RGBA64At(x, y)" data-gtmc="doc outline link"> (c) RGBA64At(x, y) </a> </li> </ul> </li> <li> <a href="#YCbCr" title="type YCbCr" data-gtmc="doc outline link"> type YCbCr </a> <ul> <li> <a href="#NewYCbCr" title="NewYCbCr(r, subsampleRatio)" data-gtmc="doc outline link"> NewYCbCr(r, subsampleRatio) </a> </li> <li> <a href="#YCbCr.At" title="(p) At(x, y)" data-gtmc="doc outline link"> (p) At(x, y) </a> </li> <li> <a href="#YCbCr.Bounds" title="(p) Bounds()" data-gtmc="doc outline link"> (p) Bounds() </a> </li> <li> <a href="#YCbCr.COffset" title="(p) COffset(x, y)" data-gtmc="doc outline link"> (p) COffset(x, y) </a> </li> <li> <a href="#YCbCr.ColorModel" title="(p) ColorModel()" data-gtmc="doc outline link"> (p) ColorModel() </a> </li> <li> <a href="#YCbCr.Opaque" title="(p) Opaque()" data-gtmc="doc outline link"> (p) Opaque() </a> </li> <li> <a href="#YCbCr.RGBA64At" title="(p) RGBA64At(x, y)" data-gtmc="doc outline link"> (p) RGBA64At(x, y) </a> </li> <li> <a href="#YCbCr.SubImage" title="(p) SubImage(r)" data-gtmc="doc outline link"> (p) SubImage(r) </a> </li> <li> <a href="#YCbCr.YCbCrAt" title="(p) YCbCrAt(x, y)" data-gtmc="doc outline link"> (p) YCbCrAt(x, y) </a> </li> <li> <a href="#YCbCr.YOffset" title="(p) YOffset(x, y)" data-gtmc="doc outline link"> (p) YOffset(x, y) </a> </li> </ul> </li> <li> <a href="#YCbCrSubsampleRatio" title="type YCbCrSubsampleRatio" data-gtmc="doc outline link"> type YCbCrSubsampleRatio </a> <ul> <li> <a href="#YCbCrSubsampleRatio.String" title="(s) String()" data-gtmc="doc outline link"> (s) String() </a> </li> </ul> </li> </ul> </li> </ul> </li> <li> <a href="#section-sourcefiles" data-gtmc="outline link"> Source Files </a> </li> <li> <a href="#section-directories" data-gtmc="outline link"> Directories </a> </li> </ul> </div> <div class="go-Main-navMobile js-mainNavMobile"> <label class="go-Label"> <select class="go-Select"> <option selected disabled>Documentation</option> </select> </label> </div> </nav> <article class="go-Main-article js-mainContent"> <div class="UnitDetails" data-test-id="UnitDetails" style="display: block;"> <div class="UnitDetails-content js-unitDetailsContent" data-test-id="UnitDetails-content"> <div class="UnitDoc"> <h2 class="UnitDoc-title" id="section-documentation"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/code_gm_grey_24dp.svg" alt=""> Documentation <a class="UnitDoc-idLink" href="#section-documentation" title="Go to Documentation" aria-label="Go to Documentation">露</a> </h2> <div class="Documentation js-documentation"> <div class="Documentation-content js-docContent"> <section class="Documentation-overview"> <h3 tabindex="-1" id="pkg-overview" class="Documentation-overviewHeader">Overview <a href="#pkg-overview" title="Go to Overview" aria-label="Go to Overview">露</a></h3> <div role="navigation" aria-label="Table of Contents"> <ul class="Documentation-toc"> <li class="Documentation-tocItem"><a href="#hdr-Security_Considerations">Security Considerations</a></li> </ul> </div> <p>Package image implements a basic 2-D image library. </p><p>The fundamental interface is called <a href="#Image">Image</a>. An <a href="#Image">Image</a> contains colors, which are described in the image/color package. </p><p>Values of the <a href="#Image">Image</a> interface are created either by calling functions such as <a href="#NewRGBA">NewRGBA</a> and <a href="#NewPaletted">NewPaletted</a>, or by calling <a href="#Decode">Decode</a> on an <a href="/io#Reader">io.Reader</a> containing image data in a format such as GIF, JPEG or PNG. Decoding any particular image format requires the prior registration of a decoder function. Registration is typically automatic as a side effect of initializing that format's package so that, to decode a PNG image, it suffices to have </p><pre>import _ "image/png" </pre><p>in a program's main package. The _ means to import a package purely for its initialization side effects. </p><p>See "The Go image package" for more details: <a href="https://golang.org/doc/articles/image_package.html">https://golang.org/doc/articles/image_package.html</a> </p><h4 id="hdr-Security_Considerations">Security Considerations <a class="Documentation-idLink" href="#hdr-Security_Considerations" title="Go to Security Considerations" aria-label="Go to Security Considerations">露</a></h4><p>The image package can be used to parse arbitrarily large images, which can cause resource exhaustion on machines which do not have enough memory to store them. When operating on arbitrary images, <a href="#DecodeConfig">DecodeConfig</a> should be called before <a href="#Decode">Decode</a>, so that the program can decide whether the image, as defined in the returned header, can be safely decoded with the available resources. A call to <a href="#Decode">Decode</a> which produces an extremely large image, as defined in the header returned by <a href="#DecodeConfig">DecodeConfig</a>, is not considered a security issue, regardless of whether the image is itself malformed or not. A call to <a href="#DecodeConfig">DecodeConfig</a> which returns a header which does not match the image returned by <a href="#Decode">Decode</a> may be considered a security issue, and should be reported per the [Go Security Policy](<a href="https://go.dev/security/policy">https://go.dev/security/policy</a>). </p> <details tabindex="-1" id="example-package" class="Documentation-exampleDetails js-exampleContainer"> <summary class="Documentation-exampleDetailsHeader">Example <a href="#example-package" title="Go to Example" aria-label="Go to Example">露</a></summary> <div class="Documentation-exampleDetailsBody"> <pre class="Documentation-exampleCode"> package main import ( "encoding/base64" "fmt" "image" "log" "strings" // Package image/jpeg is not used explicitly in the code below, // but is imported for its initialization side-effect, which allows // image.Decode to understand JPEG formatted images. Uncomment these // two lines to also understand GIF and PNG images: // _ "image/gif" // _ "image/png" _ "image/jpeg" ) func main() { // Decode the JPEG data. If reading from file, create a reader with // // reader, err := os.Open("testdata/video-001.q50.420.jpeg") // if err != nil { // log.Fatal(err) // } // defer reader.Close() reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(data)) m, _, err := image.Decode(reader) if err != nil { log.Fatal(err) } bounds := m.Bounds() // Calculate a 16-bin histogram for m's red, green, blue and alpha components. // // An image's bounds do not necessarily start at (0, 0), so the two loops start // at bounds.Min.Y and bounds.Min.X. Looping over Y first and X second is more // likely to result in better memory access patterns than X first and Y second. var histogram [16][4]int for y := bounds.Min.Y; y < bounds.Max.Y; y++ { for x := bounds.Min.X; x < bounds.Max.X; x++ { r, g, b, a := m.At(x, y).RGBA() // A color's RGBA method returns values in the range [0, 65535]. // Shifting by 12 reduces this to the range [0, 15]. histogram[r>>12][0]++ histogram[g>>12][1]++ histogram[b>>12][2]++ histogram[a>>12][3]++ } } // Print the results. fmt.Printf("%-14s %6s %6s %6s %6s\n", "bin", "red", "green", "blue", "alpha") for i, x := range histogram { fmt.Printf("0x%04x-0x%04x: %6d %6d %6d %6d\n", i<<12, (i+1)<<12-1, x[0], x[1], x[2], x[3]) } } const data = ` /9j/4AAQSkZJRgABAQIAHAAcAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdA SFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2Nj Y2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCABnAJYDASIAAhEBAxEB/8QA HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVW V1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQF BgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq 8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDlwKMD0pwzSiuK57QzGDxS7D6in8Y5ximnAPUfSlcq4m3ilUYp 2OKXHvRcVxnTtS7c07HNFK4DQPakC4PNOA+tOx70XAjK/So5gBGP94fzqfvUVx/qxx/EP51UXqRP4WSE cmgjilP3jSEZqS0IO/NGDnpUiocDg/McDjvV6HTPOdVWYgsM5KcfzzQ2JySM2jp6VYu7SWzmMUwG4cgj kMPUVBjjtTGtRu0Zopw+lFFxhinrGzuqqMsxAA9yaXFSRv5cqSEcIwYj6GpuZ30O30fSLKzhUpbpNMv3 5XGTn29BV28jt7pPLuIVljPBBFVreYx+VbqAjycgt3x14zRcNOxGyVFHQkIc/wA61exyKLbuzjdZ046d ftEuTEw3Rk9SPT8P8Kpbea3tchbyVae4JkjbbGpGdwOM89Af6ViFTWUtGdcXoM2+woK1JtpNtTcoZt+l Jt7ZqTbRtouFyPFRXI/c9D94fzqzioLsfuD/ALw/nVReqIn8LJCOTSY+tSMOTmkIpXLRu+F0t5pJxPHG wjjUAuBjJJz1+laD6Pai+WaK9SBX6puzn6ZP+NV/Dkdtc6ZNbyAFwxLAHDYPv6VoQ21nPNEEiQGEFRtk Gf0NaWTOeW7Of8QwGG4MRZnEbYXPJwRnOR0zWNXW+KrqBLUWi5EjbWCgcAA9c/gRXKYqZaGlK/LqMH0F FLtHvRSNiYD2pSDTgpp6p0ywUHoTULXYxcktzrdCf7Xo8LP/AKyEmMNjJ46dfbFWJ5TDGNwB9lFUvDV9 YrbfYGbyrjcWG88S57g+vtV26ZIvMlumKwwjLZ6V0WfU54yTvYwtbubea2WNWbzg4bYQeBgj8OtYeKhj u4y2HQxqxOD1xzxmrWAQCCGB6EGsaikndmsJxeiYzBo280/Z7UbayuaXGY5oIp+2lx9KLjIsVDeD/Rj/ ALy/zq1t96r3y4tT/vL/ADq4P3kRP4WSleTSFKkkKoCW4GaqNcMxIjXj1pxjKT0FKrGC1Nrw3vGrKkYz 5kTAr6455/HH510UdwPtRgWCbzF5+YYUf4Vwun39xpmoR3qASMmQUJwGU9Rnt/8AWrpbrxhb8/ZdOmaQ gAGZwFH5ZJrpVKVlY5ZYhN6kXiu2eO/ikZlIljAAB5yM549OawSOOlPuLqe+umuLqTfM4OSOAo7ADsKh hl/cRsTuJHPv7mlKi3sVTxNtGP20VJhThgSQaK52mnZnUqsWrpkyeUrr5pABOAPU1AGaXUCWJISHGPfP P8qL7BiKnsMg46H3qrbzupbj5mPTPTpXVSglG551SpzSsXJ4/MBUgYIxyKpySyGBYJriV1D7kRpCVH4V bSeNJ4xchni3DeqnBI+td7F4b0mKIRjT45VbktJlzk455+n6VtYzv2PNwFZWBHBGKVJDGVC54/nXQeMN NttLNkba1jgWVWDmM8bhg4/nzXLSSbXVj6fyNKUdNRp21RtIRJGrjuM0u3FQ2DbodvcEkfQmrW2vLqLl k0ejCXNFMj2/jQV9qkxSYNRcsZiq2oI32N2CkhWXJxwOe9XMcVt6hoPn6dFaW0wgRpNzvKDlz6+/0rai ryv2Jm9LHJai+ZRGCBjnr71ErdAxAY9B611t1Y2cunbbaOQ3FvKZI3UqGlZMbiWwfcfhV231iwvLSM3U lt5Uq52TuZG+hGMA12xXJGxxzjzybOQtNOvb5j9ktZJhnBIHyg+5PFX38JayqK/2eLJIBUTgkDA9q7ex itrSHFpGsUbndhRgc+g7VNIyfZJAoJZUbb3I46CtFJMylBo8sdWhmYMuCnylc9wef5VUT7+1chc5NS7h sUZO5RtIPUH3pkBDOxxxmqM9TQtn+WilhHfHaik43KTG3Z4IyPyrNVjGCsZ+dmwv6V3cXhSG8sYpJLud JJIwxChdoJGcYx/Wkg8DafA4knvLiQr/ALqj+VQpKw3FtnFFfvbiSMgZJ6/jXp2n3d9cQRBTFsKD96EP oOxPU/8A68VVtbbRtMVntbePKDLTSHJH/Aj/AEqHTvE66rq72VugMMcbSGTnL4wMAfjT5n0HyW3L+s6b baxaJBdzN+7bcrxkAhun0rz3VNCv7e7lgigknWI43xLu6jjIHTjtXqfkpPGVYsBkghTikgsYIN/lhgXb cxLkknp/ShczQ7xtY8vtEmhkj8yGRBuCnehUcnHcVtmwfJ/fQ8e7f/E12txZW91C0U6b42xlST2OR/Ko Bo1gM/uW55/1jf41nOipu7LhV5FZHIGzI6zwj/vr/Ck+yr3uYf8Ax7/CutbQdMb71tn/ALaN/jSf8I/p X/PoP++2/wAan6rAr6wzkWt0II+1Rc/7Lf4Vd1eeCSKBbdZDdShYoiZNoyfY10P/AAj2lf8APmP++2/x oPh/SjKspsozIuNrZORjp3qo0FHYPb3OZt7ae3SzjuItsiRSAgnccl/UA+3Q1yNjKLR4ZZYY5VD7tkv3 WwO/+e1evPp9nI257aJm6bioz1z1+tY+s6Hplnot9PbWMMcqwOFcLyOO1bJWMZSTOPHi+9w3mosrlyd2 9lCj02g9P/1e9a3hzxAbl2ikZRcdQueHHt7j864Y8Z4I4oRzG6urFWU5BHBB7HNJxTFGbR6he6Vpmtgm eLy5zwZI/lb8fX8azIvBUUTHdfSFP4QsYB/HNZ+k+KEnRY75hHOvAk6K/v7H9K6yyvlnQBmDZ6GsnzR0 N0oy1RzOtaN/Y1tHNFO06u+zYy4I4Jzx9KKveJblXuordSGES5b6n/62PzorKVdp2LjQTVyWz8UWEWlq jSgyxfJt6EgdDzWTdeLIZGO7zHI/hVajGmWWP+PWL8qwlAIURrhpMAHHJA71pRcZrToZzcoEuo6heakA GHk245CZ6/X1qPTLq40q+W5t2QybSpDAkEEc55/zilk5k2r91eKhLDzWz2rpsczbbuemeD76fUNG865I MiysmQMZAAwa3a5j4ftu0ByP+fh/5CulkLLG7INzhSVHqe1Fh3uOoqn9qQQxyhndmHIxwOmSR2xQ13KD KoiBZOV9JBnt707MVy5RWdNdy7wRGf3bfMinnO1jg+vY03WXLaJO3mhQ20b0zwpYf0qlG7S7icrJs08U VwumgC+YiQyeVtZH567hzj8aSL949oGhE/2v5pJCDkksQwBHC4/+vXQ8LZ2uYxxCavY7us/xCcaBfn0h b+VP0bnSrb94ZMJgOecj1rl/GfidUE2k2gy5+SeQjgA/wj3rlas2jdao48qrjLAGkSKPk4Gc1WMj92I+ lIJnU8OfxPWo5inBokmtQTmM4OOh71b0q6vbFmWCbaxHyqQGAP0PT8KhSTzVyo5ocSKA5VfTOTmqsmRd pl99XjPzThzK3zOeOSeveirNmkgg/fIpYsTkYORxRXmzlTjJqx6EVUcU7mhkKCzdAK59QI9zYxtG1fYU UVtgtmY4nZEa8Ak9aqFv3rfSiiu1nMeifDv/AJF+T/r4f+QrqqKKQwzQenNFFMCOKFIgNuThdoJ5OPSk ubeK6t3gnXdG4wwziiii/UTKMOg6dbzJLFE4dSCP3rEdeOM8805tDsGMvySgSsS6rM6gk9eAcUUVftZt 3uyVGNthuq3Eei6DK8H7sRR7YuMgHtXkc8rzTNLM26RyWY+p70UVnLY0iEsUipG7rhZBlDkc1HgYoorM 0HwyBXGeRjmrcUhMg2ghezd//rUUVcTKW5s2jZtY/QDaOKKKK8ip8bPRj8KP/9k= ` </pre> <pre><span class="Documentation-exampleOutputLabel">Output:</span> <span class="Documentation-exampleOutput">bin red green blue alpha 0x0000-0x0fff: 364 790 7242 0 0x1000-0x1fff: 645 2967 1039 0 0x2000-0x2fff: 1072 2299 979 0 0x3000-0x3fff: 820 2266 980 0 0x4000-0x4fff: 537 1305 541 0 0x5000-0x5fff: 319 962 261 0 0x6000-0x6fff: 322 375 177 0 0x7000-0x7fff: 601 279 214 0 0x8000-0x8fff: 3478 227 273 0 0x9000-0x9fff: 2260 234 329 0 0xa000-0xafff: 921 282 373 0 0xb000-0xbfff: 321 335 397 0 0xc000-0xcfff: 229 388 298 0 0xd000-0xdfff: 260 414 277 0 0xe000-0xefff: 516 428 298 0 0xf000-0xffff: 2785 1899 1772 15450 </span></pre> </div> <div class="Documentation-exampleButtonsContainer"> <p class="Documentation-exampleError" role="alert" aria-atomic="true"></p> <button class="Documentation-exampleShareButton" aria-label="Share Code">Share</button> <button class="Documentation-exampleFormatButton" aria-label="Format Code">Format</button> <button class="Documentation-exampleRunButton" aria-label="Run Code">Run</button> </div></details> <details tabindex="-1" id="example-package-DecodeConfig" class="Documentation-exampleDetails js-exampleContainer"> <summary class="Documentation-exampleDetailsHeader">Example (DecodeConfig) <a href="#example-package-DecodeConfig" title="Go to Example (DecodeConfig)" aria-label="Go to Example (DecodeConfig)">露</a></summary> <div class="Documentation-exampleDetailsBody"> <pre class="Documentation-exampleCode"> package main import ( "encoding/base64" "fmt" "image" "log" "strings" // Package image/jpeg is not used explicitly in the code below, // but is imported for its initialization side-effect, which allows // image.Decode to understand JPEG formatted images. Uncomment these // two lines to also understand GIF and PNG images: // _ "image/gif" // _ "image/png" _ "image/jpeg" ) func main() { reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(data)) config, format, err := image.DecodeConfig(reader) if err != nil { log.Fatal(err) } fmt.Println("Width:", config.Width, "Height:", config.Height, "Format:", format) } const data = ` /9j/4AAQSkZJRgABAQIAHAAcAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdA SFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2Nj Y2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCABnAJYDASIAAhEBAxEB/8QA HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVW V1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQF BgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq 8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDlwKMD0pwzSiuK57QzGDxS7D6in8Y5ximnAPUfSlcq4m3ilUYp 2OKXHvRcVxnTtS7c07HNFK4DQPakC4PNOA+tOx70XAjK/So5gBGP94fzqfvUVx/qxx/EP51UXqRP4WSE cmgjilP3jSEZqS0IO/NGDnpUiocDg/McDjvV6HTPOdVWYgsM5KcfzzQ2JySM2jp6VYu7SWzmMUwG4cgj kMPUVBjjtTGtRu0Zopw+lFFxhinrGzuqqMsxAA9yaXFSRv5cqSEcIwYj6GpuZ30O30fSLKzhUpbpNMv3 5XGTn29BV28jt7pPLuIVljPBBFVreYx+VbqAjycgt3x14zRcNOxGyVFHQkIc/wA61exyKLbuzjdZ046d ftEuTEw3Rk9SPT8P8Kpbea3tchbyVae4JkjbbGpGdwOM89Af6ViFTWUtGdcXoM2+woK1JtpNtTcoZt+l Jt7ZqTbRtouFyPFRXI/c9D94fzqzioLsfuD/ALw/nVReqIn8LJCOTSY+tSMOTmkIpXLRu+F0t5pJxPHG wjjUAuBjJJz1+laD6Pai+WaK9SBX6puzn6ZP+NV/Dkdtc6ZNbyAFwxLAHDYPv6VoQ21nPNEEiQGEFRtk Gf0NaWTOeW7Of8QwGG4MRZnEbYXPJwRnOR0zWNXW+KrqBLUWi5EjbWCgcAA9c/gRXKYqZaGlK/LqMH0F FLtHvRSNiYD2pSDTgpp6p0ywUHoTULXYxcktzrdCf7Xo8LP/AKyEmMNjJ46dfbFWJ5TDGNwB9lFUvDV9 YrbfYGbyrjcWG88S57g+vtV26ZIvMlumKwwjLZ6V0WfU54yTvYwtbubea2WNWbzg4bYQeBgj8OtYeKhj u4y2HQxqxOD1xzxmrWAQCCGB6EGsaikndmsJxeiYzBo280/Z7UbayuaXGY5oIp+2lx9KLjIsVDeD/Rj/ ALy/zq1t96r3y4tT/vL/ADq4P3kRP4WSleTSFKkkKoCW4GaqNcMxIjXj1pxjKT0FKrGC1Nrw3vGrKkYz 5kTAr6455/HH510UdwPtRgWCbzF5+YYUf4Vwun39xpmoR3qASMmQUJwGU9Rnt/8AWrpbrxhb8/ZdOmaQ gAGZwFH5ZJrpVKVlY5ZYhN6kXiu2eO/ikZlIljAAB5yM549OawSOOlPuLqe+umuLqTfM4OSOAo7ADsKh hl/cRsTuJHPv7mlKi3sVTxNtGP20VJhThgSQaK52mnZnUqsWrpkyeUrr5pABOAPU1AGaXUCWJISHGPfP P8qL7BiKnsMg46H3qrbzupbj5mPTPTpXVSglG551SpzSsXJ4/MBUgYIxyKpySyGBYJriV1D7kRpCVH4V bSeNJ4xchni3DeqnBI+td7F4b0mKIRjT45VbktJlzk455+n6VtYzv2PNwFZWBHBGKVJDGVC54/nXQeMN NttLNkba1jgWVWDmM8bhg4/nzXLSSbXVj6fyNKUdNRp21RtIRJGrjuM0u3FQ2DbodvcEkfQmrW2vLqLl k0ejCXNFMj2/jQV9qkxSYNRcsZiq2oI32N2CkhWXJxwOe9XMcVt6hoPn6dFaW0wgRpNzvKDlz6+/0rai ryv2Jm9LHJai+ZRGCBjnr71ErdAxAY9B611t1Y2cunbbaOQ3FvKZI3UqGlZMbiWwfcfhV231iwvLSM3U lt5Uq52TuZG+hGMA12xXJGxxzjzybOQtNOvb5j9ktZJhnBIHyg+5PFX38JayqK/2eLJIBUTgkDA9q7ex itrSHFpGsUbndhRgc+g7VNIyfZJAoJZUbb3I46CtFJMylBo8sdWhmYMuCnylc9wef5VUT7+1chc5NS7h sUZO5RtIPUH3pkBDOxxxmqM9TQtn+WilhHfHaik43KTG3Z4IyPyrNVjGCsZ+dmwv6V3cXhSG8sYpJLud JJIwxChdoJGcYx/Wkg8DafA4knvLiQr/ALqj+VQpKw3FtnFFfvbiSMgZJ6/jXp2n3d9cQRBTFsKD96EP oOxPU/8A68VVtbbRtMVntbePKDLTSHJH/Aj/AEqHTvE66rq72VugMMcbSGTnL4wMAfjT5n0HyW3L+s6b baxaJBdzN+7bcrxkAhun0rz3VNCv7e7lgigknWI43xLu6jjIHTjtXqfkpPGVYsBkghTikgsYIN/lhgXb cxLkknp/ShczQ7xtY8vtEmhkj8yGRBuCnehUcnHcVtmwfJ/fQ8e7f/E12txZW91C0U6b42xlST2OR/Ko Bo1gM/uW55/1jf41nOipu7LhV5FZHIGzI6zwj/vr/Ck+yr3uYf8Ax7/CutbQdMb71tn/ALaN/jSf8I/p X/PoP++2/wAan6rAr6wzkWt0II+1Rc/7Lf4Vd1eeCSKBbdZDdShYoiZNoyfY10P/AAj2lf8APmP++2/x oPh/SjKspsozIuNrZORjp3qo0FHYPb3OZt7ae3SzjuItsiRSAgnccl/UA+3Q1yNjKLR4ZZYY5VD7tkv3 WwO/+e1evPp9nI257aJm6bioz1z1+tY+s6Hplnot9PbWMMcqwOFcLyOO1bJWMZSTOPHi+9w3mosrlyd2 9lCj02g9P/1e9a3hzxAbl2ikZRcdQueHHt7j864Y8Z4I4oRzG6urFWU5BHBB7HNJxTFGbR6he6Vpmtgm eLy5zwZI/lb8fX8azIvBUUTHdfSFP4QsYB/HNZ+k+KEnRY75hHOvAk6K/v7H9K6yyvlnQBmDZ6GsnzR0 N0oy1RzOtaN/Y1tHNFO06u+zYy4I4Jzx9KKveJblXuordSGES5b6n/62PzorKVdp2LjQTVyWz8UWEWlq jSgyxfJt6EgdDzWTdeLIZGO7zHI/hVajGmWWP+PWL8qwlAIURrhpMAHHJA71pRcZrToZzcoEuo6heakA GHk245CZ6/X1qPTLq40q+W5t2QybSpDAkEEc55/zilk5k2r91eKhLDzWz2rpsczbbuemeD76fUNG865I MiysmQMZAAwa3a5j4ftu0ByP+fh/5CulkLLG7INzhSVHqe1Fh3uOoqn9qQQxyhndmHIxwOmSR2xQ13KD KoiBZOV9JBnt707MVy5RWdNdy7wRGf3bfMinnO1jg+vY03WXLaJO3mhQ20b0zwpYf0qlG7S7icrJs08U VwumgC+YiQyeVtZH567hzj8aSL949oGhE/2v5pJCDkksQwBHC4/+vXQ8LZ2uYxxCavY7us/xCcaBfn0h b+VP0bnSrb94ZMJgOecj1rl/GfidUE2k2gy5+SeQjgA/wj3rlas2jdao48qrjLAGkSKPk4Gc1WMj92I+ lIJnU8OfxPWo5inBokmtQTmM4OOh71b0q6vbFmWCbaxHyqQGAP0PT8KhSTzVyo5ocSKA5VfTOTmqsmRd pl99XjPzThzK3zOeOSeveirNmkgg/fIpYsTkYORxRXmzlTjJqx6EVUcU7mhkKCzdAK59QI9zYxtG1fYU UVtgtmY4nZEa8Ak9aqFv3rfSiiu1nMeifDv/AJF+T/r4f+QrqqKKQwzQenNFFMCOKFIgNuThdoJ5OPSk ubeK6t3gnXdG4wwziiii/UTKMOg6dbzJLFE4dSCP3rEdeOM8805tDsGMvySgSsS6rM6gk9eAcUUVftZt 3uyVGNthuq3Eei6DK8H7sRR7YuMgHtXkc8rzTNLM26RyWY+p70UVnLY0iEsUipG7rhZBlDkc1HgYoorM 0HwyBXGeRjmrcUhMg2ghezd//rUUVcTKW5s2jZtY/QDaOKKKK8ip8bPRj8KP/9k= ` </pre> <pre><span class="Documentation-exampleOutputLabel">Output:</span> <span class="Documentation-exampleOutput"></span></pre> </div> <div class="Documentation-exampleButtonsContainer"> <p class="Documentation-exampleError" role="alert" aria-atomic="true"></p> <button class="Documentation-exampleShareButton" aria-label="Share Code">Share</button> <button class="Documentation-exampleFormatButton" aria-label="Format Code">Format</button> <button class="Documentation-exampleRunButton" aria-label="Run Code">Run</button> </div></details> </section><section class="Documentation-index"> <h3 id="pkg-index" class="Documentation-indexHeader">Index <a href="#pkg-index" title="Go to Index" aria-label="Go to Index">露</a></h3> <ul class="Documentation-indexList"> <li class="Documentation-indexVariables"><a href="#pkg-variables">Variables</a></li> <li class="Documentation-indexFunction"> <a href="#RegisterFormat">func RegisterFormat(name, magic string, decode func(io.Reader) (Image, error), ...)</a></li> <li class="Documentation-indexType"> <a href="#Alpha">type Alpha</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewAlpha">func NewAlpha(r Rectangle) *Alpha</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Alpha.AlphaAt">func (p *Alpha) AlphaAt(x, y int) color.Alpha</a></li> <li> <a href="#Alpha.At">func (p *Alpha) At(x, y int) color.Color</a></li> <li> <a href="#Alpha.Bounds">func (p *Alpha) Bounds() Rectangle</a></li> <li> <a href="#Alpha.ColorModel">func (p *Alpha) ColorModel() color.Model</a></li> <li> <a href="#Alpha.Opaque">func (p *Alpha) Opaque() bool</a></li> <li> <a href="#Alpha.PixOffset">func (p *Alpha) PixOffset(x, y int) int</a></li> <li> <a href="#Alpha.RGBA64At">func (p *Alpha) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#Alpha.Set">func (p *Alpha) Set(x, y int, c color.Color)</a></li> <li> <a href="#Alpha.SetAlpha">func (p *Alpha) SetAlpha(x, y int, c color.Alpha)</a></li> <li> <a href="#Alpha.SetRGBA64">func (p *Alpha) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#Alpha.SubImage">func (p *Alpha) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Alpha16">type Alpha16</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewAlpha16">func NewAlpha16(r Rectangle) *Alpha16</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Alpha16.Alpha16At">func (p *Alpha16) Alpha16At(x, y int) color.Alpha16</a></li> <li> <a href="#Alpha16.At">func (p *Alpha16) At(x, y int) color.Color</a></li> <li> <a href="#Alpha16.Bounds">func (p *Alpha16) Bounds() Rectangle</a></li> <li> <a href="#Alpha16.ColorModel">func (p *Alpha16) ColorModel() color.Model</a></li> <li> <a href="#Alpha16.Opaque">func (p *Alpha16) Opaque() bool</a></li> <li> <a href="#Alpha16.PixOffset">func (p *Alpha16) PixOffset(x, y int) int</a></li> <li> <a href="#Alpha16.RGBA64At">func (p *Alpha16) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#Alpha16.Set">func (p *Alpha16) Set(x, y int, c color.Color)</a></li> <li> <a href="#Alpha16.SetAlpha16">func (p *Alpha16) SetAlpha16(x, y int, c color.Alpha16)</a></li> <li> <a href="#Alpha16.SetRGBA64">func (p *Alpha16) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#Alpha16.SubImage">func (p *Alpha16) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#CMYK">type CMYK</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewCMYK">func NewCMYK(r Rectangle) *CMYK</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#CMYK.At">func (p *CMYK) At(x, y int) color.Color</a></li> <li> <a href="#CMYK.Bounds">func (p *CMYK) Bounds() Rectangle</a></li> <li> <a href="#CMYK.CMYKAt">func (p *CMYK) CMYKAt(x, y int) color.CMYK</a></li> <li> <a href="#CMYK.ColorModel">func (p *CMYK) ColorModel() color.Model</a></li> <li> <a href="#CMYK.Opaque">func (p *CMYK) Opaque() bool</a></li> <li> <a href="#CMYK.PixOffset">func (p *CMYK) PixOffset(x, y int) int</a></li> <li> <a href="#CMYK.RGBA64At">func (p *CMYK) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#CMYK.Set">func (p *CMYK) Set(x, y int, c color.Color)</a></li> <li> <a href="#CMYK.SetCMYK">func (p *CMYK) SetCMYK(x, y int, c color.CMYK)</a></li> <li> <a href="#CMYK.SetRGBA64">func (p *CMYK) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#CMYK.SubImage">func (p *CMYK) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Config">type Config</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#DecodeConfig">func DecodeConfig(r io.Reader) (Config, string, error)</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Gray">type Gray</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewGray">func NewGray(r Rectangle) *Gray</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Gray.At">func (p *Gray) At(x, y int) color.Color</a></li> <li> <a href="#Gray.Bounds">func (p *Gray) Bounds() Rectangle</a></li> <li> <a href="#Gray.ColorModel">func (p *Gray) ColorModel() color.Model</a></li> <li> <a href="#Gray.GrayAt">func (p *Gray) GrayAt(x, y int) color.Gray</a></li> <li> <a href="#Gray.Opaque">func (p *Gray) Opaque() bool</a></li> <li> <a href="#Gray.PixOffset">func (p *Gray) PixOffset(x, y int) int</a></li> <li> <a href="#Gray.RGBA64At">func (p *Gray) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#Gray.Set">func (p *Gray) Set(x, y int, c color.Color)</a></li> <li> <a href="#Gray.SetGray">func (p *Gray) SetGray(x, y int, c color.Gray)</a></li> <li> <a href="#Gray.SetRGBA64">func (p *Gray) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#Gray.SubImage">func (p *Gray) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Gray16">type Gray16</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewGray16">func NewGray16(r Rectangle) *Gray16</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Gray16.At">func (p *Gray16) At(x, y int) color.Color</a></li> <li> <a href="#Gray16.Bounds">func (p *Gray16) Bounds() Rectangle</a></li> <li> <a href="#Gray16.ColorModel">func (p *Gray16) ColorModel() color.Model</a></li> <li> <a href="#Gray16.Gray16At">func (p *Gray16) Gray16At(x, y int) color.Gray16</a></li> <li> <a href="#Gray16.Opaque">func (p *Gray16) Opaque() bool</a></li> <li> <a href="#Gray16.PixOffset">func (p *Gray16) PixOffset(x, y int) int</a></li> <li> <a href="#Gray16.RGBA64At">func (p *Gray16) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#Gray16.Set">func (p *Gray16) Set(x, y int, c color.Color)</a></li> <li> <a href="#Gray16.SetGray16">func (p *Gray16) SetGray16(x, y int, c color.Gray16)</a></li> <li> <a href="#Gray16.SetRGBA64">func (p *Gray16) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#Gray16.SubImage">func (p *Gray16) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Image">type Image</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#Decode">func Decode(r io.Reader) (Image, string, error)</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#NRGBA">type NRGBA</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewNRGBA">func NewNRGBA(r Rectangle) *NRGBA</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#NRGBA.At">func (p *NRGBA) At(x, y int) color.Color</a></li> <li> <a href="#NRGBA.Bounds">func (p *NRGBA) Bounds() Rectangle</a></li> <li> <a href="#NRGBA.ColorModel">func (p *NRGBA) ColorModel() color.Model</a></li> <li> <a href="#NRGBA.NRGBAAt">func (p *NRGBA) NRGBAAt(x, y int) color.NRGBA</a></li> <li> <a href="#NRGBA.Opaque">func (p *NRGBA) Opaque() bool</a></li> <li> <a href="#NRGBA.PixOffset">func (p *NRGBA) PixOffset(x, y int) int</a></li> <li> <a href="#NRGBA.RGBA64At">func (p *NRGBA) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#NRGBA.Set">func (p *NRGBA) Set(x, y int, c color.Color)</a></li> <li> <a href="#NRGBA.SetNRGBA">func (p *NRGBA) SetNRGBA(x, y int, c color.NRGBA)</a></li> <li> <a href="#NRGBA.SetRGBA64">func (p *NRGBA) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#NRGBA.SubImage">func (p *NRGBA) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#NRGBA64">type NRGBA64</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewNRGBA64">func NewNRGBA64(r Rectangle) *NRGBA64</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#NRGBA64.At">func (p *NRGBA64) At(x, y int) color.Color</a></li> <li> <a href="#NRGBA64.Bounds">func (p *NRGBA64) Bounds() Rectangle</a></li> <li> <a href="#NRGBA64.ColorModel">func (p *NRGBA64) ColorModel() color.Model</a></li> <li> <a href="#NRGBA64.NRGBA64At">func (p *NRGBA64) NRGBA64At(x, y int) color.NRGBA64</a></li> <li> <a href="#NRGBA64.Opaque">func (p *NRGBA64) Opaque() bool</a></li> <li> <a href="#NRGBA64.PixOffset">func (p *NRGBA64) PixOffset(x, y int) int</a></li> <li> <a href="#NRGBA64.RGBA64At">func (p *NRGBA64) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#NRGBA64.Set">func (p *NRGBA64) Set(x, y int, c color.Color)</a></li> <li> <a href="#NRGBA64.SetNRGBA64">func (p *NRGBA64) SetNRGBA64(x, y int, c color.NRGBA64)</a></li> <li> <a href="#NRGBA64.SetRGBA64">func (p *NRGBA64) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#NRGBA64.SubImage">func (p *NRGBA64) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#NYCbCrA">type NYCbCrA</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewNYCbCrA">func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#NYCbCrA.AOffset">func (p *NYCbCrA) AOffset(x, y int) int</a></li> <li> <a href="#NYCbCrA.At">func (p *NYCbCrA) At(x, y int) color.Color</a></li> <li> <a href="#NYCbCrA.ColorModel">func (p *NYCbCrA) ColorModel() color.Model</a></li> <li> <a href="#NYCbCrA.NYCbCrAAt">func (p *NYCbCrA) NYCbCrAAt(x, y int) color.NYCbCrA</a></li> <li> <a href="#NYCbCrA.Opaque">func (p *NYCbCrA) Opaque() bool</a></li> <li> <a href="#NYCbCrA.RGBA64At">func (p *NYCbCrA) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#NYCbCrA.SubImage">func (p *NYCbCrA) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Paletted">type Paletted</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewPaletted">func NewPaletted(r Rectangle, p color.Palette) *Paletted</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Paletted.At">func (p *Paletted) At(x, y int) color.Color</a></li> <li> <a href="#Paletted.Bounds">func (p *Paletted) Bounds() Rectangle</a></li> <li> <a href="#Paletted.ColorIndexAt">func (p *Paletted) ColorIndexAt(x, y int) uint8</a></li> <li> <a href="#Paletted.ColorModel">func (p *Paletted) ColorModel() color.Model</a></li> <li> <a href="#Paletted.Opaque">func (p *Paletted) Opaque() bool</a></li> <li> <a href="#Paletted.PixOffset">func (p *Paletted) PixOffset(x, y int) int</a></li> <li> <a href="#Paletted.RGBA64At">func (p *Paletted) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#Paletted.Set">func (p *Paletted) Set(x, y int, c color.Color)</a></li> <li> <a href="#Paletted.SetColorIndex">func (p *Paletted) SetColorIndex(x, y int, index uint8)</a></li> <li> <a href="#Paletted.SetRGBA64">func (p *Paletted) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#Paletted.SubImage">func (p *Paletted) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#PalettedImage">type PalettedImage</a></li> <li class="Documentation-indexType"> <a href="#Point">type Point</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#Pt">func Pt(X, Y int) Point</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Point.Add">func (p Point) Add(q Point) Point</a></li> <li> <a href="#Point.Div">func (p Point) Div(k int) Point</a></li> <li> <a href="#Point.Eq">func (p Point) Eq(q Point) bool</a></li> <li> <a href="#Point.In">func (p Point) In(r Rectangle) bool</a></li> <li> <a href="#Point.Mod">func (p Point) Mod(r Rectangle) Point</a></li> <li> <a href="#Point.Mul">func (p Point) Mul(k int) Point</a></li> <li> <a href="#Point.String">func (p Point) String() string</a></li> <li> <a href="#Point.Sub">func (p Point) Sub(q Point) Point</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#RGBA">type RGBA</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewRGBA">func NewRGBA(r Rectangle) *RGBA</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#RGBA.At">func (p *RGBA) At(x, y int) color.Color</a></li> <li> <a href="#RGBA.Bounds">func (p *RGBA) Bounds() Rectangle</a></li> <li> <a href="#RGBA.ColorModel">func (p *RGBA) ColorModel() color.Model</a></li> <li> <a href="#RGBA.Opaque">func (p *RGBA) Opaque() bool</a></li> <li> <a href="#RGBA.PixOffset">func (p *RGBA) PixOffset(x, y int) int</a></li> <li> <a href="#RGBA.RGBA64At">func (p *RGBA) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#RGBA.RGBAAt">func (p *RGBA) RGBAAt(x, y int) color.RGBA</a></li> <li> <a href="#RGBA.Set">func (p *RGBA) Set(x, y int, c color.Color)</a></li> <li> <a href="#RGBA.SetRGBA">func (p *RGBA) SetRGBA(x, y int, c color.RGBA)</a></li> <li> <a href="#RGBA.SetRGBA64">func (p *RGBA) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#RGBA.SubImage">func (p *RGBA) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#RGBA64">type RGBA64</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewRGBA64">func NewRGBA64(r Rectangle) *RGBA64</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#RGBA64.At">func (p *RGBA64) At(x, y int) color.Color</a></li> <li> <a href="#RGBA64.Bounds">func (p *RGBA64) Bounds() Rectangle</a></li> <li> <a href="#RGBA64.ColorModel">func (p *RGBA64) ColorModel() color.Model</a></li> <li> <a href="#RGBA64.Opaque">func (p *RGBA64) Opaque() bool</a></li> <li> <a href="#RGBA64.PixOffset">func (p *RGBA64) PixOffset(x, y int) int</a></li> <li> <a href="#RGBA64.RGBA64At">func (p *RGBA64) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#RGBA64.Set">func (p *RGBA64) Set(x, y int, c color.Color)</a></li> <li> <a href="#RGBA64.SetRGBA64">func (p *RGBA64) SetRGBA64(x, y int, c color.RGBA64)</a></li> <li> <a href="#RGBA64.SubImage">func (p *RGBA64) SubImage(r Rectangle) Image</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#RGBA64Image">type RGBA64Image</a></li> <li class="Documentation-indexType"> <a href="#Rectangle">type Rectangle</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#Rect">func Rect(x0, y0, x1, y1 int) Rectangle</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Rectangle.Add">func (r Rectangle) Add(p Point) Rectangle</a></li> <li> <a href="#Rectangle.At">func (r Rectangle) At(x, y int) color.Color</a></li> <li> <a href="#Rectangle.Bounds">func (r Rectangle) Bounds() Rectangle</a></li> <li> <a href="#Rectangle.Canon">func (r Rectangle) Canon() Rectangle</a></li> <li> <a href="#Rectangle.ColorModel">func (r Rectangle) ColorModel() color.Model</a></li> <li> <a href="#Rectangle.Dx">func (r Rectangle) Dx() int</a></li> <li> <a href="#Rectangle.Dy">func (r Rectangle) Dy() int</a></li> <li> <a href="#Rectangle.Empty">func (r Rectangle) Empty() bool</a></li> <li> <a href="#Rectangle.Eq">func (r Rectangle) Eq(s Rectangle) bool</a></li> <li> <a href="#Rectangle.In">func (r Rectangle) In(s Rectangle) bool</a></li> <li> <a href="#Rectangle.Inset">func (r Rectangle) Inset(n int) Rectangle</a></li> <li> <a href="#Rectangle.Intersect">func (r Rectangle) Intersect(s Rectangle) Rectangle</a></li> <li> <a href="#Rectangle.Overlaps">func (r Rectangle) Overlaps(s Rectangle) bool</a></li> <li> <a href="#Rectangle.RGBA64At">func (r Rectangle) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#Rectangle.Size">func (r Rectangle) Size() Point</a></li> <li> <a href="#Rectangle.String">func (r Rectangle) String() string</a></li> <li> <a href="#Rectangle.Sub">func (r Rectangle) Sub(p Point) Rectangle</a></li> <li> <a href="#Rectangle.Union">func (r Rectangle) Union(s Rectangle) Rectangle</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#Uniform">type Uniform</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewUniform">func NewUniform(c color.Color) *Uniform</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#Uniform.At">func (c *Uniform) At(x, y int) color.Color</a></li> <li> <a href="#Uniform.Bounds">func (c *Uniform) Bounds() Rectangle</a></li> <li> <a href="#Uniform.ColorModel">func (c *Uniform) ColorModel() color.Model</a></li> <li> <a href="#Uniform.Convert">func (c *Uniform) Convert(color.Color) color.Color</a></li> <li> <a href="#Uniform.Opaque">func (c *Uniform) Opaque() bool</a></li> <li> <a href="#Uniform.RGBA">func (c *Uniform) RGBA() (r, g, b, a uint32)</a></li> <li> <a href="#Uniform.RGBA64At">func (c *Uniform) RGBA64At(x, y int) color.RGBA64</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#YCbCr">type YCbCr</a></li> <li><ul class="Documentation-indexTypeFunctions"> <li> <a href="#NewYCbCr">func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr</a></li> </ul></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#YCbCr.At">func (p *YCbCr) At(x, y int) color.Color</a></li> <li> <a href="#YCbCr.Bounds">func (p *YCbCr) Bounds() Rectangle</a></li> <li> <a href="#YCbCr.COffset">func (p *YCbCr) COffset(x, y int) int</a></li> <li> <a href="#YCbCr.ColorModel">func (p *YCbCr) ColorModel() color.Model</a></li> <li> <a href="#YCbCr.Opaque">func (p *YCbCr) Opaque() bool</a></li> <li> <a href="#YCbCr.RGBA64At">func (p *YCbCr) RGBA64At(x, y int) color.RGBA64</a></li> <li> <a href="#YCbCr.SubImage">func (p *YCbCr) SubImage(r Rectangle) Image</a></li> <li> <a href="#YCbCr.YCbCrAt">func (p *YCbCr) YCbCrAt(x, y int) color.YCbCr</a></li> <li> <a href="#YCbCr.YOffset">func (p *YCbCr) YOffset(x, y int) int</a></li> </ul></li> <li class="Documentation-indexType"> <a href="#YCbCrSubsampleRatio">type YCbCrSubsampleRatio</a></li> <li><ul class="Documentation-indexTypeMethods"> <li> <a href="#YCbCrSubsampleRatio.String">func (s YCbCrSubsampleRatio) String() string</a></li> </ul></li> </ul> </section><section class="Documentation-examples"> <h4 tabindex="-1" id="pkg-examples" class="Documentation-examplesHeader">Examples <a class="Documentation-idLink" href="#pkg-examples" title="Go to Examples" aria-label="Go to Examples">露</a></h4> <ul class="Documentation-examplesList"> <li><a href="#example-package" class="js-exampleHref">Package</a></li> <li><a href="#example-package-DecodeConfig" class="js-exampleHref">Package (DecodeConfig)</a></li> </ul> </section><h3 tabindex="-1" id="pkg-constants" class="Documentation-constantsHeader">Constants <a href="#pkg-constants" title="Go to Constants" aria-label="Go to Constants">露</a></h3> <section class="Documentation-constants"><p class="Documentation-empty">This section is empty.</p></section> <h3 tabindex="-1" id="pkg-variables" class="Documentation-variablesHeader">Variables <a href="#pkg-variables" title="Go to Variables" aria-label="Go to Variables">露</a></h3> <section class="Documentation-variables"> <div class="Documentation-declaration"> <span class="Documentation-declarationLink"><a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=11">View Source</a></span> <pre>var ( <span id="Black" data-kind="variable"> <span class="comment">// Black is an opaque black uniform image.</span> </span> Black = <a href="#NewUniform">NewUniform</a>(<a href="/image/color">color</a>.<a href="/image/color#Black">Black</a>) <span id="White" data-kind="variable"> <span class="comment">// White is an opaque white uniform image.</span> </span> White = <a href="#NewUniform">NewUniform</a>(<a href="/image/color">color</a>.<a href="/image/color#White">White</a>) <span id="Transparent" data-kind="variable"> <span class="comment">// Transparent is a fully transparent uniform image.</span> </span> Transparent = <a href="#NewUniform">NewUniform</a>(<a href="/image/color">color</a>.<a href="/image/color#Transparent">Transparent</a>) <span id="Opaque" data-kind="variable"> <span class="comment">// Opaque is a fully opaque uniform image.</span> </span> Opaque = <a href="#NewUniform">NewUniform</a>(<a href="/image/color">color</a>.<a href="/image/color#Opaque">Opaque</a>) )</pre> </div> <div class="Documentation-declaration"> <span class="Documentation-declarationLink"><a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/format.go;l=16">View Source</a></span> <pre><span id="ErrFormat" data-kind="variable">var ErrFormat = <a href="/errors">errors</a>.<a href="/errors#New">New</a>("image: unknown format")</span></pre> </div> <p>ErrFormat indicates that decoding encountered an unknown format. </p> </section> <h3 tabindex="-1" id="pkg-functions" class="Documentation-functionsHeader">Functions <a href="#pkg-functions" title="Go to Functions" aria-label="Go to Functions">露</a></h3> <section class="Documentation-functions"><div class="Documentation-function"> <h4 tabindex="-1" id="RegisterFormat" data-kind="function" class="Documentation-functionHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/format.go;l=37">RegisterFormat</a> <a class="Documentation-idLink" href="#RegisterFormat" title="Go to RegisterFormat" aria-label="Go to RegisterFormat">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func RegisterFormat(name, magic <a href="/builtin#string">string</a>, decode func(<a href="/io">io</a>.<a href="/io#Reader">Reader</a>) (<a href="#Image">Image</a>, <a href="/builtin#error">error</a>), decodeConfig func(<a href="/io">io</a>.<a href="/io#Reader">Reader</a>) (<a href="#Config">Config</a>, <a href="/builtin#error">error</a>))</pre> </div> <p>RegisterFormat registers an image format for use by <a href="#Decode">Decode</a>. Name is the name of the format, like "jpeg" or "png". Magic is the magic prefix that identifies the format's encoding. The magic string can contain "?" wildcards that each match any one byte. <a href="#Decode">Decode</a> is the function that decodes the encoded image. <a href="#DecodeConfig">DecodeConfig</a> is the function that decodes just its configuration. </p> </div></section> <h3 tabindex="-1" id="pkg-types" class="Documentation-typesHeader">Types <a href="#pkg-types" title="Go to Types" aria-label="Go to Types">露</a></h3> <section class="Documentation-types"><div class="Documentation-type"> <h4 tabindex="-1" id="Alpha" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=624">Alpha</a> <a class="Documentation-idLink" href="#Alpha" title="Go to Alpha" aria-label="Go to Alpha">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Alpha struct { <span id="Alpha.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, as alpha values. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="Alpha.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="Alpha.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>Alpha is an in-memory image whose At method returns <a href="/image/color#Alpha">color.Alpha</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewAlpha" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=723">NewAlpha</a> <a class="Documentation-idLink" href="#NewAlpha" title="Go to NewAlpha" aria-label="Go to NewAlpha">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewAlpha(r <a href="#Rectangle">Rectangle</a>) *<a href="#Alpha">Alpha</a></pre> </div> <p>NewAlpha returns a new <a href="#Alpha">Alpha</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.AlphaAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=648">AlphaAt</a> <a class="Documentation-idLink" href="#Alpha.AlphaAt" title="Go to Alpha.AlphaAt" aria-label="Go to Alpha.AlphaAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) AlphaAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Alpha">Alpha</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=638">At</a> <a class="Documentation-idLink" href="#Alpha.At" title="Go to Alpha.At" aria-label="Go to Alpha.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=636">Bounds</a> <a class="Documentation-idLink" href="#Alpha.Bounds" title="Go to Alpha.Bounds" aria-label="Go to Alpha.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=634">ColorModel</a> <a class="Documentation-idLink" href="#Alpha.ColorModel" title="Go to Alpha.ColorModel" aria-label="Go to Alpha.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=705">Opaque</a> <a class="Documentation-idLink" href="#Alpha.Opaque" title="Go to Alpha.Opaque" aria-label="Go to Alpha.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=658">PixOffset</a> <a class="Documentation-idLink" href="#Alpha.PixOffset" title="Go to Alpha.PixOffset" aria-label="Go to Alpha.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=642">RGBA64At</a> <a class="Documentation-idLink" href="#Alpha.RGBA64At" title="Go to Alpha.RGBA64At" aria-label="Go to Alpha.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=662">Set</a> <a class="Documentation-idLink" href="#Alpha.Set" title="Go to Alpha.Set" aria-label="Go to Alpha.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.SetAlpha" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=678">SetAlpha</a> <a class="Documentation-idLink" href="#Alpha.SetAlpha" title="Go to Alpha.SetAlpha" aria-label="Go to Alpha.SetAlpha">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) SetAlpha(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Alpha">Alpha</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=670">SetRGBA64</a> <a class="Documentation-idLink" href="#Alpha.SetRGBA64" title="Go to Alpha.SetRGBA64" aria-label="Go to Alpha.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=688">SubImage</a> <a class="Documentation-idLink" href="#Alpha.SubImage" title="Go to Alpha.SubImage" aria-label="Go to Alpha.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha">Alpha</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Alpha16" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=732">Alpha16</a> <a class="Documentation-idLink" href="#Alpha16" title="Go to Alpha16" aria-label="Go to Alpha16">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Alpha16 struct { <span id="Alpha16.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, as alpha values in big-endian format. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="Alpha16.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="Alpha16.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>Alpha16 is an in-memory image whose At method returns <a href="/image/color#Alpha16">color.Alpha16</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewAlpha16" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=834">NewAlpha16</a> <a class="Documentation-idLink" href="#NewAlpha16" title="Go to NewAlpha16" aria-label="Go to NewAlpha16">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewAlpha16(r <a href="#Rectangle">Rectangle</a>) *<a href="#Alpha16">Alpha16</a></pre> </div> <p>NewAlpha16 returns a new <a href="#Alpha16">Alpha16</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.Alpha16At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=755">Alpha16At</a> <a class="Documentation-idLink" href="#Alpha16.Alpha16At" title="Go to Alpha16.Alpha16At" aria-label="Go to Alpha16.Alpha16At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) Alpha16At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Alpha16">Alpha16</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=746">At</a> <a class="Documentation-idLink" href="#Alpha16.At" title="Go to Alpha16.At" aria-label="Go to Alpha16.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=744">Bounds</a> <a class="Documentation-idLink" href="#Alpha16.Bounds" title="Go to Alpha16.Bounds" aria-label="Go to Alpha16.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=742">ColorModel</a> <a class="Documentation-idLink" href="#Alpha16.ColorModel" title="Go to Alpha16.ColorModel" aria-label="Go to Alpha16.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=816">Opaque</a> <a class="Documentation-idLink" href="#Alpha16.Opaque" title="Go to Alpha16.Opaque" aria-label="Go to Alpha16.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=765">PixOffset</a> <a class="Documentation-idLink" href="#Alpha16.PixOffset" title="Go to Alpha16.PixOffset" aria-label="Go to Alpha16.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=750">RGBA64At</a> <a class="Documentation-idLink" href="#Alpha16.RGBA64At" title="Go to Alpha16.RGBA64At" aria-label="Go to Alpha16.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=769">Set</a> <a class="Documentation-idLink" href="#Alpha16.Set" title="Go to Alpha16.Set" aria-label="Go to Alpha16.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.SetAlpha16" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=788">SetAlpha16</a> <a class="Documentation-idLink" href="#Alpha16.SetAlpha16" title="Go to Alpha16.SetAlpha16" aria-label="Go to Alpha16.SetAlpha16">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) SetAlpha16(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Alpha16">Alpha16</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=779">SetRGBA64</a> <a class="Documentation-idLink" href="#Alpha16.SetRGBA64" title="Go to Alpha16.SetRGBA64" aria-label="Go to Alpha16.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Alpha16.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Alpha16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=799">SubImage</a> <a class="Documentation-idLink" href="#Alpha16.SubImage" title="Go to Alpha16.SubImage" aria-label="Go to Alpha16.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Alpha16">Alpha16</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="CMYK" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1040">CMYK</a> <a class="Documentation-idLink" href="#CMYK" title="Go to CMYK" aria-label="Go to CMYK">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>type CMYK struct { <span id="CMYK.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, in C, M, Y, K order. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="CMYK.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="CMYK.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>CMYK is an in-memory image whose At method returns <a href="/image/color#CMYK">color.CMYK</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewCMYK" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1140">NewCMYK</a> <a class="Documentation-idLink" href="#NewCMYK" title="Go to NewCMYK" aria-label="Go to NewCMYK">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func NewCMYK(r <a href="#Rectangle">Rectangle</a>) *<a href="#CMYK">CMYK</a></pre> </div> <p>NewCMYK returns a new CMYK image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1054">At</a> <a class="Documentation-idLink" href="#CMYK.At" title="Go to CMYK.At" aria-label="Go to CMYK.At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1052">Bounds</a> <a class="Documentation-idLink" href="#CMYK.Bounds" title="Go to CMYK.Bounds" aria-label="Go to CMYK.Bounds">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.CMYKAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1063">CMYKAt</a> <a class="Documentation-idLink" href="#CMYK.CMYKAt" title="Go to CMYK.CMYKAt" aria-label="Go to CMYK.CMYKAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) CMYKAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#CMYK">CMYK</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1050">ColorModel</a> <a class="Documentation-idLink" href="#CMYK.ColorModel" title="Go to CMYK.ColorModel" aria-label="Go to CMYK.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1135">Opaque</a> <a class="Documentation-idLink" href="#CMYK.Opaque" title="Go to CMYK.Opaque" aria-label="Go to CMYK.Opaque">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1074">PixOffset</a> <a class="Documentation-idLink" href="#CMYK.PixOffset" title="Go to CMYK.PixOffset" aria-label="Go to CMYK.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1058">RGBA64At</a> <a class="Documentation-idLink" href="#CMYK.RGBA64At" title="Go to CMYK.RGBA64At" aria-label="Go to CMYK.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1078">Set</a> <a class="Documentation-idLink" href="#CMYK.Set" title="Go to CMYK.Set" aria-label="Go to CMYK.Set">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.SetCMYK" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1104">SetCMYK</a> <a class="Documentation-idLink" href="#CMYK.SetCMYK" title="Go to CMYK.SetCMYK" aria-label="Go to CMYK.SetCMYK">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) SetCMYK(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#CMYK">CMYK</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1091">SetRGBA64</a> <a class="Documentation-idLink" href="#CMYK.SetRGBA64" title="Go to CMYK.SetRGBA64" aria-label="Go to CMYK.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="CMYK.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*CMYK) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1118">SubImage</a> <a class="Documentation-idLink" href="#CMYK.SubImage" title="Go to CMYK.SubImage" aria-label="Go to CMYK.SubImage">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#CMYK">CMYK</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Config" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=45">Config</a> <a class="Documentation-idLink" href="#Config" title="Go to Config" aria-label="Go to Config">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Config struct { <span id="Config.ColorModel" data-kind="field"> ColorModel <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a> </span><span id="Config.Width" data-kind="field"><span id="Config.Height" data-kind="field"> Width, Height <a href="/builtin#int">int</a> </span>}</pre> </div> <p>Config holds an image's color model and dimensions. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="DecodeConfig" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/format.go;l=101">DecodeConfig</a> <a class="Documentation-idLink" href="#DecodeConfig" title="Go to DecodeConfig" aria-label="Go to DecodeConfig">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func DecodeConfig(r <a href="/io">io</a>.<a href="/io#Reader">Reader</a>) (<a href="#Config">Config</a>, <a href="/builtin#string">string</a>, <a href="/builtin#error">error</a>)</pre> </div> <p>DecodeConfig decodes the color model and dimensions of an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec-specific package. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Gray" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=843">Gray</a> <a class="Documentation-idLink" href="#Gray" title="Go to Gray" aria-label="Go to Gray">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Gray struct { <span id="Gray.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, as gray values. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="Gray.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="Gray.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>Gray is an in-memory image whose At method returns <a href="/image/color#Gray">color.Gray</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewGray" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=931">NewGray</a> <a class="Documentation-idLink" href="#NewGray" title="Go to NewGray" aria-label="Go to NewGray">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewGray(r <a href="#Rectangle">Rectangle</a>) *<a href="#Gray">Gray</a></pre> </div> <p>NewGray returns a new <a href="#Gray">Gray</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=857">At</a> <a class="Documentation-idLink" href="#Gray.At" title="Go to Gray.At" aria-label="Go to Gray.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=855">Bounds</a> <a class="Documentation-idLink" href="#Gray.Bounds" title="Go to Gray.Bounds" aria-label="Go to Gray.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=853">ColorModel</a> <a class="Documentation-idLink" href="#Gray.ColorModel" title="Go to Gray.ColorModel" aria-label="Go to Gray.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.GrayAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=867">GrayAt</a> <a class="Documentation-idLink" href="#Gray.GrayAt" title="Go to Gray.GrayAt" aria-label="Go to Gray.GrayAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) GrayAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Gray">Gray</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=926">Opaque</a> <a class="Documentation-idLink" href="#Gray.Opaque" title="Go to Gray.Opaque" aria-label="Go to Gray.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=877">PixOffset</a> <a class="Documentation-idLink" href="#Gray.PixOffset" title="Go to Gray.PixOffset" aria-label="Go to Gray.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=861">RGBA64At</a> <a class="Documentation-idLink" href="#Gray.RGBA64At" title="Go to Gray.RGBA64At" aria-label="Go to Gray.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=881">Set</a> <a class="Documentation-idLink" href="#Gray.Set" title="Go to Gray.Set" aria-label="Go to Gray.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.SetGray" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=899">SetGray</a> <a class="Documentation-idLink" href="#Gray.SetGray" title="Go to Gray.SetGray" aria-label="Go to Gray.SetGray">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) SetGray(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Gray">Gray</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=889">SetRGBA64</a> <a class="Documentation-idLink" href="#Gray.SetRGBA64" title="Go to Gray.SetRGBA64" aria-label="Go to Gray.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=909">SubImage</a> <a class="Documentation-idLink" href="#Gray.SubImage" title="Go to Gray.SubImage" aria-label="Go to Gray.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray">Gray</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Gray16" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=940">Gray16</a> <a class="Documentation-idLink" href="#Gray16" title="Go to Gray16" aria-label="Go to Gray16">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Gray16 struct { <span id="Gray16.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, as gray values in big-endian format. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="Gray16.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="Gray16.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>Gray16 is an in-memory image whose At method returns <a href="/image/color#Gray16">color.Gray16</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewGray16" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1031">NewGray16</a> <a class="Documentation-idLink" href="#NewGray16" title="Go to NewGray16" aria-label="Go to NewGray16">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewGray16(r <a href="#Rectangle">Rectangle</a>) *<a href="#Gray16">Gray16</a></pre> </div> <p>NewGray16 returns a new <a href="#Gray16">Gray16</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=954">At</a> <a class="Documentation-idLink" href="#Gray16.At" title="Go to Gray16.At" aria-label="Go to Gray16.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=952">Bounds</a> <a class="Documentation-idLink" href="#Gray16.Bounds" title="Go to Gray16.Bounds" aria-label="Go to Gray16.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=950">ColorModel</a> <a class="Documentation-idLink" href="#Gray16.ColorModel" title="Go to Gray16.ColorModel" aria-label="Go to Gray16.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.Gray16At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=963">Gray16At</a> <a class="Documentation-idLink" href="#Gray16.Gray16At" title="Go to Gray16.Gray16At" aria-label="Go to Gray16.Gray16At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) Gray16At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Gray16">Gray16</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1026">Opaque</a> <a class="Documentation-idLink" href="#Gray16.Opaque" title="Go to Gray16.Opaque" aria-label="Go to Gray16.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=973">PixOffset</a> <a class="Documentation-idLink" href="#Gray16.PixOffset" title="Go to Gray16.PixOffset" aria-label="Go to Gray16.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=958">RGBA64At</a> <a class="Documentation-idLink" href="#Gray16.RGBA64At" title="Go to Gray16.RGBA64At" aria-label="Go to Gray16.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=977">Set</a> <a class="Documentation-idLink" href="#Gray16.Set" title="Go to Gray16.Set" aria-label="Go to Gray16.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.SetGray16" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=998">SetGray16</a> <a class="Documentation-idLink" href="#Gray16.SetGray16" title="Go to Gray16.SetGray16" aria-label="Go to Gray16.SetGray16">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) SetGray16(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Gray16">Gray16</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=987">SetRGBA64</a> <a class="Documentation-idLink" href="#Gray16.SetRGBA64" title="Go to Gray16.SetRGBA64" aria-label="Go to Gray16.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Gray16.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Gray16) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1009">SubImage</a> <a class="Documentation-idLink" href="#Gray16.SubImage" title="Go to Gray16.SubImage" aria-label="Go to Gray16.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Gray16">Gray16</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Image" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=52">Image</a> <a class="Documentation-idLink" href="#Image" title="Go to Image" aria-label="Go to Image">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Image interface { <span id="Image.ColorModel" data-kind="method"> <span class="comment">// ColorModel returns the Image's color model.</span> </span> ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a> <span id="Image.Bounds" data-kind="method"> <span class="comment">// Bounds returns the domain for which At can return non-zero color.</span> </span> <span class="comment">// The bounds do not necessarily contain the point (0, 0).</span> Bounds() <a href="#Rectangle">Rectangle</a> <span id="Image.At" data-kind="method"> <span class="comment">// At returns the color of the pixel at (x, y).</span> </span> <span class="comment">// At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid.</span> <span class="comment">// At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.</span> At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a> }</pre> </div> <p>Image is a finite rectangular grid of <a href="/image/color#Color">color.Color</a> values taken from a color model. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="Decode" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/format.go;l=87">Decode</a> <a class="Documentation-idLink" href="#Decode" title="Go to Decode" aria-label="Go to Decode">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func Decode(r <a href="/io">io</a>.<a href="/io#Reader">Reader</a>) (<a href="#Image">Image</a>, <a href="/builtin#string">string</a>, <a href="/builtin#error">error</a>)</pre> </div> <p>Decode decodes an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec- specific package. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="NRGBA" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=353">NRGBA</a> <a class="Documentation-idLink" href="#NRGBA" title="Go to NRGBA" aria-label="Go to NRGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type NRGBA struct { <span id="NRGBA.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, in R, G, B, A order. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="NRGBA.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="NRGBA.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>NRGBA is an in-memory image whose At method returns <a href="/image/color#NRGBA">color.NRGBA</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewNRGBA" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=471">NewNRGBA</a> <a class="Documentation-idLink" href="#NewNRGBA" title="Go to NewNRGBA" aria-label="Go to NewNRGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewNRGBA(r <a href="#Rectangle">Rectangle</a>) *<a href="#NRGBA">NRGBA</a></pre> </div> <p>NewNRGBA returns a new <a href="#NRGBA">NRGBA</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=367">At</a> <a class="Documentation-idLink" href="#NRGBA.At" title="Go to NRGBA.At" aria-label="Go to NRGBA.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=365">Bounds</a> <a class="Documentation-idLink" href="#NRGBA.Bounds" title="Go to NRGBA.Bounds" aria-label="Go to NRGBA.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=363">ColorModel</a> <a class="Documentation-idLink" href="#NRGBA.ColorModel" title="Go to NRGBA.ColorModel" aria-label="Go to NRGBA.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.NRGBAAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=376">NRGBAAt</a> <a class="Documentation-idLink" href="#NRGBA.NRGBAAt" title="Go to NRGBA.NRGBAAt" aria-label="Go to NRGBA.NRGBAAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) NRGBAAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#NRGBA">NRGBA</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=453">Opaque</a> <a class="Documentation-idLink" href="#NRGBA.Opaque" title="Go to NRGBA.Opaque" aria-label="Go to NRGBA.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=387">PixOffset</a> <a class="Documentation-idLink" href="#NRGBA.PixOffset" title="Go to NRGBA.PixOffset" aria-label="Go to NRGBA.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=371">RGBA64At</a> <a class="Documentation-idLink" href="#NRGBA.RGBA64At" title="Go to NRGBA.RGBA64At" aria-label="Go to NRGBA.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=391">Set</a> <a class="Documentation-idLink" href="#NRGBA.Set" title="Go to NRGBA.Set" aria-label="Go to NRGBA.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.SetNRGBA" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=422">SetNRGBA</a> <a class="Documentation-idLink" href="#NRGBA.SetNRGBA" title="Go to NRGBA.SetNRGBA" aria-label="Go to NRGBA.SetNRGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) SetNRGBA(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#NRGBA">NRGBA</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=404">SetRGBA64</a> <a class="Documentation-idLink" href="#NRGBA.SetRGBA64" title="Go to NRGBA.SetRGBA64" aria-label="Go to NRGBA.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=436">SubImage</a> <a class="Documentation-idLink" href="#NRGBA.SubImage" title="Go to NRGBA.SubImage" aria-label="Go to NRGBA.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA">NRGBA</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="NRGBA64" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=480">NRGBA64</a> <a class="Documentation-idLink" href="#NRGBA64" title="Go to NRGBA64" aria-label="Go to NRGBA64">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type NRGBA64 struct { <span id="NRGBA64.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, in R, G, B, A order and big-endian format. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*8].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="NRGBA64.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="NRGBA64.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>NRGBA64 is an in-memory image whose At method returns <a href="/image/color#NRGBA64">color.NRGBA64</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewNRGBA64" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=615">NewNRGBA64</a> <a class="Documentation-idLink" href="#NewNRGBA64" title="Go to NewNRGBA64" aria-label="Go to NewNRGBA64">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewNRGBA64(r <a href="#Rectangle">Rectangle</a>) *<a href="#NRGBA64">NRGBA64</a></pre> </div> <p>NewNRGBA64 returns a new <a href="#NRGBA64">NRGBA64</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=494">At</a> <a class="Documentation-idLink" href="#NRGBA64.At" title="Go to NRGBA64.At" aria-label="Go to NRGBA64.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=492">Bounds</a> <a class="Documentation-idLink" href="#NRGBA64.Bounds" title="Go to NRGBA64.Bounds" aria-label="Go to NRGBA64.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=490">ColorModel</a> <a class="Documentation-idLink" href="#NRGBA64.ColorModel" title="Go to NRGBA64.ColorModel" aria-label="Go to NRGBA64.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.NRGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=503">NRGBA64At</a> <a class="Documentation-idLink" href="#NRGBA64.NRGBA64At" title="Go to NRGBA64.NRGBA64At" aria-label="Go to NRGBA64.NRGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) NRGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#NRGBA64">NRGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=597">Opaque</a> <a class="Documentation-idLink" href="#NRGBA64.Opaque" title="Go to NRGBA64.Opaque" aria-label="Go to NRGBA64.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=519">PixOffset</a> <a class="Documentation-idLink" href="#NRGBA64.PixOffset" title="Go to NRGBA64.PixOffset" aria-label="Go to NRGBA64.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=498">RGBA64At</a> <a class="Documentation-idLink" href="#NRGBA64.RGBA64At" title="Go to NRGBA64.RGBA64At" aria-label="Go to NRGBA64.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=523">Set</a> <a class="Documentation-idLink" href="#NRGBA64.Set" title="Go to NRGBA64.Set" aria-label="Go to NRGBA64.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.SetNRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=562">SetNRGBA64</a> <a class="Documentation-idLink" href="#NRGBA64.SetNRGBA64" title="Go to NRGBA64.SetNRGBA64" aria-label="Go to NRGBA64.SetNRGBA64">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) SetNRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#NRGBA64">NRGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=540">SetRGBA64</a> <a class="Documentation-idLink" href="#NRGBA64.SetRGBA64" title="Go to NRGBA64.SetRGBA64" aria-label="Go to NRGBA64.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NRGBA64.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NRGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=580">SubImage</a> <a class="Documentation-idLink" href="#NRGBA64.SubImage" title="Go to NRGBA64.SubImage" aria-label="Go to NRGBA64.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NRGBA64">NRGBA64</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="NYCbCrA" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=205">NYCbCrA</a> <a class="Documentation-idLink" href="#NYCbCrA" title="Go to NYCbCrA" aria-label="Go to NYCbCrA">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>type NYCbCrA struct { <span id="NYCbCrA.YCbCr" data-kind="field"> <a href="#YCbCr">YCbCr</a> </span><span id="NYCbCrA.A" data-kind="field"> A []<a href="/builtin#uint8">uint8</a> </span><span id="NYCbCrA.AStride" data-kind="field"> AStride <a href="/builtin#int">int</a> </span>}</pre> </div> <p>NYCbCrA is an in-memory image of non-alpha-premultiplied Y'CbCr-with-alpha colors. A and AStride are analogous to the Y and YStride fields of the embedded YCbCr. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewNYCbCrA" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=299">NewNYCbCrA</a> <a class="Documentation-idLink" href="#NewNYCbCrA" title="Go to NewNYCbCrA" aria-label="Go to NewNYCbCrA">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func NewNYCbCrA(r <a href="#Rectangle">Rectangle</a>, subsampleRatio <a href="#YCbCrSubsampleRatio">YCbCrSubsampleRatio</a>) *<a href="#NYCbCrA">NYCbCrA</a></pre> </div> <p>NewNYCbCrA returns a new <a href="#NYCbCrA">NYCbCrA</a> image with the given bounds and subsample ratio. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.AOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=243">AOffset</a> <a class="Documentation-idLink" href="#NYCbCrA.AOffset" title="Go to NYCbCrA.AOffset" aria-label="Go to NYCbCrA.AOffset">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) AOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>AOffset returns the index of the first element of A that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=215">At</a> <a class="Documentation-idLink" href="#NYCbCrA.At" title="Go to NYCbCrA.At" aria-label="Go to NYCbCrA.At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=211">ColorModel</a> <a class="Documentation-idLink" href="#NYCbCrA.ColorModel" title="Go to NYCbCrA.ColorModel" aria-label="Go to NYCbCrA.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.NYCbCrAAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=224">NYCbCrAAt</a> <a class="Documentation-idLink" href="#NYCbCrA.NYCbCrAAt" title="Go to NYCbCrA.NYCbCrAAt" aria-label="Go to NYCbCrA.NYCbCrAAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) NYCbCrAAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#NYCbCrA">NYCbCrA</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=280">Opaque</a> <a class="Documentation-idLink" href="#NYCbCrA.Opaque" title="Go to NYCbCrA.Opaque" aria-label="Go to NYCbCrA.Opaque">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=219">RGBA64At</a> <a class="Documentation-idLink" href="#NYCbCrA.RGBA64At" title="Go to NYCbCrA.RGBA64At" aria-label="Go to NYCbCrA.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="NYCbCrA.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*NYCbCrA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=249">SubImage</a> <a class="Documentation-idLink" href="#NYCbCrA.SubImage" title="Go to NYCbCrA.SubImage" aria-label="Go to NYCbCrA.SubImage">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.6</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#NYCbCrA">NYCbCrA</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Paletted" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1149">Paletted</a> <a class="Documentation-idLink" href="#Paletted" title="Go to Paletted" aria-label="Go to Paletted">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Paletted struct { <span id="Paletted.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, as palette indices. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="Paletted.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="Paletted.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> <span id="Paletted.Palette" data-kind="field"> <span class="comment">// Palette is the image's palette.</span> </span> Palette <a href="/image/color">color</a>.<a href="/image/color#Palette">Palette</a> }</pre> </div> <p>Paletted is an in-memory image of uint8 indices into a given palette. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewPaletted" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1280">NewPaletted</a> <a class="Documentation-idLink" href="#NewPaletted" title="Go to NewPaletted" aria-label="Go to NewPaletted">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewPaletted(r <a href="#Rectangle">Rectangle</a>, p <a href="/image/color">color</a>.<a href="/image/color#Palette">Palette</a>) *<a href="#Paletted">Paletted</a></pre> </div> <p>NewPaletted returns a new <a href="#Paletted">Paletted</a> image with the given width, height and palette. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1165">At</a> <a class="Documentation-idLink" href="#Paletted.At" title="Go to Paletted.At" aria-label="Go to Paletted.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1163">Bounds</a> <a class="Documentation-idLink" href="#Paletted.Bounds" title="Go to Paletted.Bounds" aria-label="Go to Paletted.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.ColorIndexAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1218">ColorIndexAt</a> <a class="Documentation-idLink" href="#Paletted.ColorIndexAt" title="Go to Paletted.ColorIndexAt" aria-label="Go to Paletted.ColorIndexAt">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) ColorIndexAt(x, y <a href="/builtin#int">int</a>) <a href="/builtin#uint8">uint8</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1161">ColorModel</a> <a class="Documentation-idLink" href="#Paletted.ColorModel" title="Go to Paletted.ColorModel" aria-label="Go to Paletted.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1256">Opaque</a> <a class="Documentation-idLink" href="#Paletted.Opaque" title="Go to Paletted.Opaque" aria-label="Go to Paletted.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1198">PixOffset</a> <a class="Documentation-idLink" href="#Paletted.PixOffset" title="Go to Paletted.PixOffset" aria-label="Go to Paletted.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1176">RGBA64At</a> <a class="Documentation-idLink" href="#Paletted.RGBA64At" title="Go to Paletted.RGBA64At" aria-label="Go to Paletted.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1202">Set</a> <a class="Documentation-idLink" href="#Paletted.Set" title="Go to Paletted.Set" aria-label="Go to Paletted.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.SetColorIndex" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1226">SetColorIndex</a> <a class="Documentation-idLink" href="#Paletted.SetColorIndex" title="Go to Paletted.SetColorIndex" aria-label="Go to Paletted.SetColorIndex">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) SetColorIndex(x, y <a href="/builtin#int">int</a>, index <a href="/builtin#uint8">uint8</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1210">SetRGBA64</a> <a class="Documentation-idLink" href="#Paletted.SetRGBA64" title="Go to Paletted.SetRGBA64" aria-label="Go to Paletted.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Paletted.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Paletted) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=1236">SubImage</a> <a class="Documentation-idLink" href="#Paletted.SubImage" title="Go to Paletted.SubImage" aria-label="Go to Paletted.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#Paletted">Paletted</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="PalettedImage" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=80">PalettedImage</a> <a class="Documentation-idLink" href="#PalettedImage" title="Go to PalettedImage" aria-label="Go to PalettedImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type PalettedImage interface { <span id="PalettedImage.ColorIndexAt" data-kind="method"> <span class="comment">// ColorIndexAt returns the palette index of the pixel at (x, y).</span> </span> ColorIndexAt(x, y <a href="/builtin#int">int</a>) <a href="/builtin#uint8">uint8</a> <a href="#Image">Image</a> }</pre> </div> <p>PalettedImage is an image whose colors may come from a limited palette. If m is a PalettedImage and m.ColorModel() returns a <a href="/image/color#Palette">color.Palette</a> p, then m.At(x, y) should be equivalent to p[m.ColorIndexAt(x, y)]. If m's color model is not a color.Palette, then ColorIndexAt's behavior is undefined. </p> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Point" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=14">Point</a> <a class="Documentation-idLink" href="#Point" title="Go to Point" aria-label="Go to Point">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Point struct { <span id="Point.X" data-kind="field"><span id="Point.Y" data-kind="field"> X, Y <a href="/builtin#int">int</a> </span>}</pre> </div> <p>A Point is an X, Y coordinate pair. The axes increase right and down. </p> <div class="Documentation-typeVariable"> <div class="Documentation-declaration"> <pre><span id="ZP" data-kind="variable">var ZP <a href="#Point">Point</a></span></pre> </div> <p>ZP is the zero <a href="#Point">Point</a>. </p><p>Deprecated: Use a literal <a href="#Point">image.Point</a> instead. </p> </div><div class="Documentation-typeFunc"> <h4 tabindex="-1" id="Pt" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=76">Pt</a> <a class="Documentation-idLink" href="#Pt" title="Go to Pt" aria-label="Go to Pt">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func Pt(X, Y <a href="/builtin#int">int</a>) <a href="#Point">Point</a></pre> </div> <p>Pt is shorthand for <a href="#Point">Point</a>{X, Y}. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.Add" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=24">Add</a> <a class="Documentation-idLink" href="#Point.Add" title="Go to Point.Add" aria-label="Go to Point.Add">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) Add(q <a href="#Point">Point</a>) <a href="#Point">Point</a></pre> </div> <p>Add returns the vector p+q. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.Div" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=39">Div</a> <a class="Documentation-idLink" href="#Point.Div" title="Go to Point.Div" aria-label="Go to Point.Div">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) Div(k <a href="/builtin#int">int</a>) <a href="#Point">Point</a></pre> </div> <p>Div returns the vector p/k. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.Eq" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=66">Eq</a> <a class="Documentation-idLink" href="#Point.Eq" title="Go to Point.Eq" aria-label="Go to Point.Eq">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) Eq(q <a href="#Point">Point</a>) <a href="/builtin#bool">bool</a></pre> </div> <p>Eq reports whether p and q are equal. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.In" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=44">In</a> <a class="Documentation-idLink" href="#Point.In" title="Go to Point.In" aria-label="Go to Point.In">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) In(r <a href="#Rectangle">Rectangle</a>) <a href="/builtin#bool">bool</a></pre> </div> <p>In reports whether p is in r. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.Mod" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=51">Mod</a> <a class="Documentation-idLink" href="#Point.Mod" title="Go to Point.Mod" aria-label="Go to Point.Mod">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) Mod(r <a href="#Rectangle">Rectangle</a>) <a href="#Point">Point</a></pre> </div> <p>Mod returns the point q in r such that p.X-q.X is a multiple of r's width and p.Y-q.Y is a multiple of r's height. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.Mul" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=34">Mul</a> <a class="Documentation-idLink" href="#Point.Mul" title="Go to Point.Mul" aria-label="Go to Point.Mul">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) Mul(k <a href="/builtin#int">int</a>) <a href="#Point">Point</a></pre> </div> <p>Mul returns the vector p*k. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.String" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=19">String</a> <a class="Documentation-idLink" href="#Point.String" title="Go to Point.String" aria-label="Go to Point.String">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) String() <a href="/builtin#string">string</a></pre> </div> <p>String returns a string representation of p like "(3,4)". </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Point.Sub" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Point) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=29">Sub</a> <a class="Documentation-idLink" href="#Point.Sub" title="Go to Point.Sub" aria-label="Go to Point.Sub">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p <a href="#Point">Point</a>) Sub(q <a href="#Point">Point</a>) <a href="#Point">Point</a></pre> </div> <p>Sub returns the vector p-q. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="RGBA" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=102">RGBA</a> <a class="Documentation-idLink" href="#RGBA" title="Go to RGBA" aria-label="Go to RGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type RGBA struct { <span id="RGBA.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, in R, G, B, A order. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="RGBA.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="RGBA.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>RGBA is an in-memory image whose At method returns <a href="/image/color#RGBA">color.RGBA</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewRGBA" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=227">NewRGBA</a> <a class="Documentation-idLink" href="#NewRGBA" title="Go to NewRGBA" aria-label="Go to NewRGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewRGBA(r <a href="#Rectangle">Rectangle</a>) *<a href="#RGBA">RGBA</a></pre> </div> <p>NewRGBA returns a new <a href="#RGBA">RGBA</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=116">At</a> <a class="Documentation-idLink" href="#RGBA.At" title="Go to RGBA.At" aria-label="Go to RGBA.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=114">Bounds</a> <a class="Documentation-idLink" href="#RGBA.Bounds" title="Go to RGBA.Bounds" aria-label="Go to RGBA.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=112">ColorModel</a> <a class="Documentation-idLink" href="#RGBA.ColorModel" title="Go to RGBA.ColorModel" aria-label="Go to RGBA.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=209">Opaque</a> <a class="Documentation-idLink" href="#RGBA.Opaque" title="Go to RGBA.Opaque" aria-label="Go to RGBA.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=149">PixOffset</a> <a class="Documentation-idLink" href="#RGBA.PixOffset" title="Go to RGBA.PixOffset" aria-label="Go to RGBA.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=120">RGBA64At</a> <a class="Documentation-idLink" href="#RGBA.RGBA64At" title="Go to RGBA.RGBA64At" aria-label="Go to RGBA.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.RGBAAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=138">RGBAAt</a> <a class="Documentation-idLink" href="#RGBA.RGBAAt" title="Go to RGBA.RGBAAt" aria-label="Go to RGBA.RGBAAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) RGBAAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA">RGBA</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=153">Set</a> <a class="Documentation-idLink" href="#RGBA.Set" title="Go to RGBA.Set" aria-label="Go to RGBA.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.SetRGBA" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=178">SetRGBA</a> <a class="Documentation-idLink" href="#RGBA.SetRGBA" title="Go to RGBA.SetRGBA" aria-label="Go to RGBA.SetRGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) SetRGBA(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA">RGBA</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=166">SetRGBA64</a> <a class="Documentation-idLink" href="#RGBA.SetRGBA64" title="Go to RGBA.SetRGBA64" aria-label="Go to RGBA.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=192">SubImage</a> <a class="Documentation-idLink" href="#RGBA.SubImage" title="Go to RGBA.SubImage" aria-label="Go to RGBA.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA">RGBA</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="RGBA64" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=236">RGBA64</a> <a class="Documentation-idLink" href="#RGBA64" title="Go to RGBA64" aria-label="Go to RGBA64">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type RGBA64 struct { <span id="RGBA64.Pix" data-kind="field"> <span class="comment">// Pix holds the image's pixels, in R, G, B, A order and big-endian format. The pixel at</span> </span> <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*8].</span> Pix []<a href="/builtin#uint8">uint8</a> <span id="RGBA64.Stride" data-kind="field"> <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span> </span> Stride <a href="/builtin#int">int</a> <span id="RGBA64.Rect" data-kind="field"> <span class="comment">// Rect is the image's bounds.</span> </span> Rect <a href="#Rectangle">Rectangle</a> }</pre> </div> <p>RGBA64 is an in-memory image whose At method returns <a href="/image/color#RGBA64">color.RGBA64</a> values. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewRGBA64" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=344">NewRGBA64</a> <a class="Documentation-idLink" href="#NewRGBA64" title="Go to NewRGBA64" aria-label="Go to NewRGBA64">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewRGBA64(r <a href="#Rectangle">Rectangle</a>) *<a href="#RGBA64">RGBA64</a></pre> </div> <p>NewRGBA64 returns a new <a href="#RGBA64">RGBA64</a> image with the given bounds. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=250">At</a> <a class="Documentation-idLink" href="#RGBA64.At" title="Go to RGBA64.At" aria-label="Go to RGBA64.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=248">Bounds</a> <a class="Documentation-idLink" href="#RGBA64.Bounds" title="Go to RGBA64.Bounds" aria-label="Go to RGBA64.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=246">ColorModel</a> <a class="Documentation-idLink" href="#RGBA64.ColorModel" title="Go to RGBA64.ColorModel" aria-label="Go to RGBA64.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=326">Opaque</a> <a class="Documentation-idLink" href="#RGBA64.Opaque" title="Go to RGBA64.Opaque" aria-label="Go to RGBA64.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.PixOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=270">PixOffset</a> <a class="Documentation-idLink" href="#RGBA64.PixOffset" title="Go to RGBA64.PixOffset" aria-label="Go to RGBA64.PixOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) PixOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=254">RGBA64At</a> <a class="Documentation-idLink" href="#RGBA64.RGBA64At" title="Go to RGBA64.RGBA64At" aria-label="Go to RGBA64.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.Set" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=274">Set</a> <a class="Documentation-idLink" href="#RGBA64.Set" title="Go to RGBA64.Set" aria-label="Go to RGBA64.Set">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) Set(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.SetRGBA64" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=291">SetRGBA64</a> <a class="Documentation-idLink" href="#RGBA64.SetRGBA64" title="Go to RGBA64.SetRGBA64" aria-label="Go to RGBA64.SetRGBA64">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) SetRGBA64(x, y <a href="/builtin#int">int</a>, c <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="RGBA64.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*RGBA64) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=309">SubImage</a> <a class="Documentation-idLink" href="#RGBA64.SubImage" title="Go to RGBA64.SubImage" aria-label="Go to RGBA64.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#RGBA64">RGBA64</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="RGBA64Image" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go;l=66">RGBA64Image</a> <a class="Documentation-idLink" href="#RGBA64Image" title="Go to RGBA64Image" aria-label="Go to RGBA64Image">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>type RGBA64Image interface { <span id="RGBA64Image.RGBA64At" data-kind="method"> <span class="comment">// RGBA64At returns the RGBA64 color of the pixel at (x, y). It is</span> </span> <span class="comment">// equivalent to calling At(x, y).RGBA() and converting the resulting</span> <span class="comment">// 32-bit return values to a color.RGBA64, but it can avoid allocations</span> <span class="comment">// from converting concrete color types to the color.Color interface type.</span> RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a> <a href="#Image">Image</a> }</pre> </div> <p>RGBA64Image is an <a href="#Image">Image</a> whose pixels can be converted directly to a color.RGBA64. </p> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Rectangle" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=88">Rectangle</a> <a class="Documentation-idLink" href="#Rectangle" title="Go to Rectangle" aria-label="Go to Rectangle">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Rectangle struct { <span id="Rectangle.Min" data-kind="field"><span id="Rectangle.Max" data-kind="field"> Min, Max <a href="#Point">Point</a> </span>}</pre> </div> <p>A Rectangle contains the points with Min.X <= X < Max.X, Min.Y <= Y < Max.Y. It is well-formed if Min.X <= Max.X and likewise for Y. Points are always well-formed. A rectangle's methods always return well-formed outputs for well-formed inputs. </p><p>A Rectangle is also an <a href="#Image">Image</a> whose bounds are the rectangle itself. At returns color.Opaque for points in the rectangle and color.Transparent otherwise. </p> <div class="Documentation-typeVariable"> <div class="Documentation-declaration"> <pre><span id="ZR" data-kind="variable">var ZR <a href="#Rectangle">Rectangle</a></span></pre> </div> <p>ZR is the zero <a href="#Rectangle">Rectangle</a>. </p><p>Deprecated: Use a literal <a href="#Rectangle">image.Rectangle</a> instead. </p> </div><div class="Documentation-typeFunc"> <h4 tabindex="-1" id="Rect" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=275">Rect</a> <a class="Documentation-idLink" href="#Rect" title="Go to Rect" aria-label="Go to Rect">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func Rect(x0, y0, x1, y1 <a href="/builtin#int">int</a>) <a href="#Rectangle">Rectangle</a></pre> </div> <p>Rect is shorthand for <a href="#Rectangle">Rectangle</a>{Pt(x0, y0), <a href="#Pt">Pt</a>(x1, y1)}. The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Add" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=116">Add</a> <a class="Documentation-idLink" href="#Rectangle.Add" title="Go to Rectangle.Add" aria-label="Go to Rectangle.Add">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Add(p <a href="#Point">Point</a>) <a href="#Rectangle">Rectangle</a></pre> </div> <p>Add returns the rectangle r translated by p. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=242">At</a> <a class="Documentation-idLink" href="#Rectangle.At" title="Go to Rectangle.At" aria-label="Go to Rectangle.At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> <p>At implements the <a href="#Image">Image</a> interface. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=258">Bounds</a> <a class="Documentation-idLink" href="#Rectangle.Bounds" title="Go to Rectangle.Bounds" aria-label="Go to Rectangle.Bounds">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> <p>Bounds implements the <a href="#Image">Image</a> interface. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Canon" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=231">Canon</a> <a class="Documentation-idLink" href="#Rectangle.Canon" title="Go to Rectangle.Canon" aria-label="Go to Rectangle.Canon">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Canon() <a href="#Rectangle">Rectangle</a></pre> </div> <p>Canon returns the canonical version of r. The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=263">ColorModel</a> <a class="Documentation-idLink" href="#Rectangle.ColorModel" title="Go to Rectangle.ColorModel" aria-label="Go to Rectangle.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.5</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> <p>ColorModel implements the <a href="#Image">Image</a> interface. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Dx" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=98">Dx</a> <a class="Documentation-idLink" href="#Rectangle.Dx" title="Go to Rectangle.Dx" aria-label="Go to Rectangle.Dx">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Dx() <a href="/builtin#int">int</a></pre> </div> <p>Dx returns r's width. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Dy" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=103">Dy</a> <a class="Documentation-idLink" href="#Rectangle.Dy" title="Go to Rectangle.Dy" aria-label="Go to Rectangle.Dy">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Dy() <a href="/builtin#int">int</a></pre> </div> <p>Dy returns r's height. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Empty" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=201">Empty</a> <a class="Documentation-idLink" href="#Rectangle.Empty" title="Go to Rectangle.Empty" aria-label="Go to Rectangle.Empty">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Empty() <a href="/builtin#bool">bool</a></pre> </div> <p>Empty reports whether the rectangle contains no points. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Eq" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=207">Eq</a> <a class="Documentation-idLink" href="#Rectangle.Eq" title="Go to Rectangle.Eq" aria-label="Go to Rectangle.Eq">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Eq(s <a href="#Rectangle">Rectangle</a>) <a href="/builtin#bool">bool</a></pre> </div> <p>Eq reports whether r and s contain the same set of points. All empty rectangles are considered equal. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.In" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=219">In</a> <a class="Documentation-idLink" href="#Rectangle.In" title="Go to Rectangle.In" aria-label="Go to Rectangle.In">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) In(s <a href="#Rectangle">Rectangle</a>) <a href="/builtin#bool">bool</a></pre> </div> <p>In reports whether every point in r is in s. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Inset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=134">Inset</a> <a class="Documentation-idLink" href="#Rectangle.Inset" title="Go to Rectangle.Inset" aria-label="Go to Rectangle.Inset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Inset(n <a href="/builtin#int">int</a>) <a href="#Rectangle">Rectangle</a></pre> </div> <p>Inset returns the rectangle r inset by n, which may be negative. If either of r's dimensions is less than 2*n then an empty rectangle near the center of r will be returned. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Intersect" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=154">Intersect</a> <a class="Documentation-idLink" href="#Rectangle.Intersect" title="Go to Rectangle.Intersect" aria-label="Go to Rectangle.Intersect">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Intersect(s <a href="#Rectangle">Rectangle</a>) <a href="#Rectangle">Rectangle</a></pre> </div> <p>Intersect returns the largest rectangle contained by both r and s. If the two rectangles do not overlap then the zero rectangle will be returned. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Overlaps" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=212">Overlaps</a> <a class="Documentation-idLink" href="#Rectangle.Overlaps" title="Go to Rectangle.Overlaps" aria-label="Go to Rectangle.Overlaps">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Overlaps(s <a href="#Rectangle">Rectangle</a>) <a href="/builtin#bool">bool</a></pre> </div> <p>Overlaps reports whether r and s have a non-empty intersection. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=250">RGBA64At</a> <a class="Documentation-idLink" href="#Rectangle.RGBA64At" title="Go to Rectangle.RGBA64At" aria-label="Go to Rectangle.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> <p>RGBA64At implements the <a href="#RGBA64Image">RGBA64Image</a> interface. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Size" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=108">Size</a> <a class="Documentation-idLink" href="#Rectangle.Size" title="Go to Rectangle.Size" aria-label="Go to Rectangle.Size">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Size() <a href="#Point">Point</a></pre> </div> <p>Size returns r's width and height. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.String" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=93">String</a> <a class="Documentation-idLink" href="#Rectangle.String" title="Go to Rectangle.String" aria-label="Go to Rectangle.String">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) String() <a href="/builtin#string">string</a></pre> </div> <p>String returns a string representation of r like "(3,4)-(6,5)". </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Sub" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=124">Sub</a> <a class="Documentation-idLink" href="#Rectangle.Sub" title="Go to Rectangle.Sub" aria-label="Go to Rectangle.Sub">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Sub(p <a href="#Point">Point</a>) <a href="#Rectangle">Rectangle</a></pre> </div> <p>Sub returns the rectangle r translated by -p. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Rectangle.Union" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (Rectangle) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go;l=178">Union</a> <a class="Documentation-idLink" href="#Rectangle.Union" title="Go to Rectangle.Union" aria-label="Go to Rectangle.Union">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (r <a href="#Rectangle">Rectangle</a>) Union(s <a href="#Rectangle">Rectangle</a>) <a href="#Rectangle">Rectangle</a></pre> </div> <p>Union returns the smallest rectangle that contains both r and s. </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="Uniform" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=24">Uniform</a> <a class="Documentation-idLink" href="#Uniform" title="Go to Uniform" aria-label="Go to Uniform">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type Uniform struct { <span id="Uniform.C" data-kind="field"> C <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a> </span>}</pre> </div> <p>Uniform is an infinite-sized <a href="#Image">Image</a> of uniform color. It implements the <a href="/image/color#Color">color.Color</a>, <a href="/image/color#Model">color.Model</a>, and <a href="#Image">Image</a> interfaces. </p> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewUniform" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=56">NewUniform</a> <a class="Documentation-idLink" href="#NewUniform" title="Go to NewUniform" aria-label="Go to NewUniform">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewUniform(c <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>) *<a href="#Uniform">Uniform</a></pre> </div> <p>NewUniform returns a new <a href="#Uniform">Uniform</a> image of the given color. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=42">At</a> <a class="Documentation-idLink" href="#Uniform.At" title="Go to Uniform.At" aria-label="Go to Uniform.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=40">Bounds</a> <a class="Documentation-idLink" href="#Uniform.Bounds" title="Go to Uniform.Bounds" aria-label="Go to Uniform.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=32">ColorModel</a> <a class="Documentation-idLink" href="#Uniform.ColorModel" title="Go to Uniform.ColorModel" aria-label="Go to Uniform.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.Convert" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=36">Convert</a> <a class="Documentation-idLink" href="#Uniform.Convert" title="Go to Uniform.Convert" aria-label="Go to Uniform.Convert">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) Convert(<a href="/image/color">color</a>.<a href="/image/color#Color">Color</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=50">Opaque</a> <a class="Documentation-idLink" href="#Uniform.Opaque" title="Go to Uniform.Opaque" aria-label="Go to Uniform.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> <p>Opaque scans the entire image and reports whether it is fully opaque. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.RGBA" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=28">RGBA</a> <a class="Documentation-idLink" href="#Uniform.RGBA" title="Go to Uniform.RGBA" aria-label="Go to Uniform.RGBA">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) RGBA() (r, g, b, a <a href="/builtin#uint32">uint32</a>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="Uniform.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*Uniform) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go;l=44">RGBA64At</a> <a class="Documentation-idLink" href="#Uniform.RGBA64At" title="Go to Uniform.RGBA64At" aria-label="Go to Uniform.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (c *<a href="#Uniform">Uniform</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="YCbCr" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=55">YCbCr</a> <a class="Documentation-idLink" href="#YCbCr" title="Go to YCbCr" aria-label="Go to YCbCr">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type YCbCr struct { <span id="YCbCr.Y" data-kind="field"><span id="YCbCr.Cb" data-kind="field"><span id="YCbCr.Cr" data-kind="field"> Y, Cb, Cr []<a href="/builtin#uint8">uint8</a> </span><span id="YCbCr.YStride" data-kind="field"> YStride <a href="/builtin#int">int</a> </span><span id="YCbCr.CStride" data-kind="field"> CStride <a href="/builtin#int">int</a> </span><span id="YCbCr.SubsampleRatio" data-kind="field"> SubsampleRatio <a href="#YCbCrSubsampleRatio">YCbCrSubsampleRatio</a> </span><span id="YCbCr.Rect" data-kind="field"> Rect <a href="#Rectangle">Rectangle</a> </span>}</pre> </div> <p>YCbCr is an in-memory image of Y'CbCr colors. There is one Y sample per pixel, but each Cb and Cr sample can span one or more pixels. YStride is the Y slice index delta between vertically adjacent pixels. CStride is the Cb and Cr slice index delta between vertically adjacent pixels that map to separate chroma samples. It is not an absolute requirement, but YStride and len(Y) are typically multiples of 8, and: </p><pre>For 4:4:4, CStride == YStride/1 && len(Cb) == len(Cr) == len(Y)/1. For 4:2:2, CStride == YStride/2 && len(Cb) == len(Cr) == len(Y)/2. For 4:2:0, CStride == YStride/2 && len(Cb) == len(Cr) == len(Y)/4. For 4:4:0, CStride == YStride/1 && len(Cb) == len(Cr) == len(Y)/2. For 4:1:1, CStride == YStride/4 && len(Cb) == len(Cr) == len(Y)/4. For 4:1:0, CStride == YStride/4 && len(Cb) == len(Cr) == len(Y)/8. </pre> <div class="Documentation-typeFunc"> <h4 tabindex="-1" id="NewYCbCr" data-kind="function" class="Documentation-typeFuncHeader"> <span>func <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=175">NewYCbCr</a> <a class="Documentation-idLink" href="#NewYCbCr" title="Go to NewYCbCr" aria-label="Go to NewYCbCr">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func NewYCbCr(r <a href="#Rectangle">Rectangle</a>, subsampleRatio <a href="#YCbCrSubsampleRatio">YCbCrSubsampleRatio</a>) *<a href="#YCbCr">YCbCr</a></pre> </div> <p>NewYCbCr returns a new YCbCr image with the given bounds and subsample ratio. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=71">At</a> <a class="Documentation-idLink" href="#YCbCr.At" title="Go to YCbCr.At" aria-label="Go to YCbCr.At">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#Color">Color</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.Bounds" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=67">Bounds</a> <a class="Documentation-idLink" href="#YCbCr.Bounds" title="Go to YCbCr.Bounds" aria-label="Go to YCbCr.Bounds">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) Bounds() <a href="#Rectangle">Rectangle</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.COffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=101">COffset</a> <a class="Documentation-idLink" href="#YCbCr.COffset" title="Go to YCbCr.COffset" aria-label="Go to YCbCr.COffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) COffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>COffset returns the index of the first element of Cb or Cr that corresponds to the pixel at (x, y). </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.ColorModel" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=63">ColorModel</a> <a class="Documentation-idLink" href="#YCbCr.ColorModel" title="Go to YCbCr.ColorModel" aria-label="Go to YCbCr.ColorModel">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) ColorModel() <a href="/image/color">color</a>.<a href="/image/color#Model">Model</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.Opaque" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=143">Opaque</a> <a class="Documentation-idLink" href="#YCbCr.Opaque" title="Go to YCbCr.Opaque" aria-label="Go to YCbCr.Opaque">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) Opaque() <a href="/builtin#bool">bool</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.RGBA64At" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=75">RGBA64At</a> <a class="Documentation-idLink" href="#YCbCr.RGBA64At" title="Go to YCbCr.RGBA64At" aria-label="Go to YCbCr.RGBA64At">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.17</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) RGBA64At(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#RGBA64">RGBA64</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.SubImage" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=120">SubImage</a> <a class="Documentation-idLink" href="#YCbCr.SubImage" title="Go to YCbCr.SubImage" aria-label="Go to YCbCr.SubImage">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) SubImage(r <a href="#Rectangle">Rectangle</a>) <a href="#Image">Image</a></pre> </div> <p>SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. </p> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.YCbCrAt" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=80">YCbCrAt</a> <a class="Documentation-idLink" href="#YCbCr.YCbCrAt" title="Go to YCbCr.YCbCrAt" aria-label="Go to YCbCr.YCbCrAt">露</a></span> <span class="Documentation-sinceVersion"> <span class="Documentation-sinceVersionLabel">added in</span> <span class="Documentation-sinceVersionVersion">go1.4</span> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) YCbCrAt(x, y <a href="/builtin#int">int</a>) <a href="/image/color">color</a>.<a href="/image/color#YCbCr">YCbCr</a></pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCr.YOffset" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (*YCbCr) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=95">YOffset</a> <a class="Documentation-idLink" href="#YCbCr.YOffset" title="Go to YCbCr.YOffset" aria-label="Go to YCbCr.YOffset">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (p *<a href="#YCbCr">YCbCr</a>) YOffset(x, y <a href="/builtin#int">int</a>) <a href="/builtin#int">int</a></pre> </div> <p>YOffset returns the index of the first element of Y that corresponds to the pixel at (x, y). </p> </div> </div><div class="Documentation-type"> <h4 tabindex="-1" id="YCbCrSubsampleRatio" data-kind="type" class="Documentation-typeHeader"> <span>type <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=12">YCbCrSubsampleRatio</a> <a class="Documentation-idLink" href="#YCbCrSubsampleRatio" title="Go to YCbCrSubsampleRatio" aria-label="Go to YCbCrSubsampleRatio">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>type YCbCrSubsampleRatio <a href="/builtin#int">int</a></pre> </div> <p>YCbCrSubsampleRatio is the chroma subsample ratio used in a YCbCr image. </p> <div class="Documentation-typeConstant"> <div class="Documentation-declaration"> <pre>const ( <span id="YCbCrSubsampleRatio444" data-kind="constant"> YCbCrSubsampleRatio444 <a href="#YCbCrSubsampleRatio">YCbCrSubsampleRatio</a> = <a href="/builtin#iota">iota</a> </span><span id="YCbCrSubsampleRatio422" data-kind="constant"> YCbCrSubsampleRatio422 </span><span id="YCbCrSubsampleRatio420" data-kind="constant"> YCbCrSubsampleRatio420 </span><span id="YCbCrSubsampleRatio440" data-kind="constant"> YCbCrSubsampleRatio440 </span><span id="YCbCrSubsampleRatio411" data-kind="constant"> YCbCrSubsampleRatio411 </span><span id="YCbCrSubsampleRatio410" data-kind="constant"> YCbCrSubsampleRatio410 </span>)</pre> </div> </div><div class="Documentation-typeMethod"> <h4 tabindex="-1" id="YCbCrSubsampleRatio.String" data-kind="method" class="Documentation-typeMethodHeader"> <span>func (YCbCrSubsampleRatio) <a class="Documentation-source" href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go;l=23">String</a> <a class="Documentation-idLink" href="#YCbCrSubsampleRatio.String" title="Go to YCbCrSubsampleRatio.String" aria-label="Go to YCbCrSubsampleRatio.String">露</a></span> <span class="Documentation-sinceVersion"> </span> </h4> <div class="Documentation-declaration"> <pre>func (s <a href="#YCbCrSubsampleRatio">YCbCrSubsampleRatio</a>) String() <a href="/builtin#string">string</a></pre> </div> </div> </div></section></div> </div> </div> <div class="UnitFiles js-unitFiles"> <h2 class="UnitFiles-title" id="section-sourcefiles"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/insert_drive_file_gm_grey_24dp.svg" alt=""> Source Files <a class="UnitFiles-idLink" href="#section-sourcefiles" title="Go to Source Files" aria-label="Go to Source Files">露</a> </h2> <div class="UnitFiles-titleLink"> <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/image" target="_blank" rel="noopener">View all Source files</a> </div> <div> <ul class="UnitFiles-fileList"><li> <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/format.go" target="_blank" rel="noopener" title="format.go">format.go</a> </li><li> <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/geom.go" target="_blank" rel="noopener" title="geom.go">geom.go</a> </li><li> <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/image.go" target="_blank" rel="noopener" title="image.go">image.go</a> </li><li> <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/names.go" target="_blank" rel="noopener" title="names.go">names.go</a> </li><li> <a href="https://cs.opensource.google/go/go/+/go1.24.2:src/image/ycbcr.go" target="_blank" rel="noopener" title="ycbcr.go">ycbcr.go</a> </li></ul> </div> </div> <div class="UnitDirectories js-unitDirectories"> <h2 class="UnitDirectories-title" id="section-directories"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/folder_gm_grey_24dp.svg" alt=""> Directories <a class="UnitDirectories-idLink" href="#section-directories" title="Go to Directories" aria-label="Go to Directories">露</a> </h2> <div class="UnitDirectories-toggles"> <div class="UnitDirectories-toggleButtons"> <button class="js-showInternalDirectories" data-test-id="internal-directories-toggle" data-gtmc="directories button" aria-label="Show Internal Directories"> Show internal </button> <button class="js-expandAllDirectories" data-test-id="directories-toggle" data-gtmc="directories button" aria-label="Expand All Directories"> Expand all </button> </div> </div> <table class="UnitDirectories-table UnitDirectories-table--tree js-expandableTable" data-test-id="UnitDirectories-table"> <tr class="UnitDirectories-tableHeader UnitDirectories-tableHeader--tree"> <th>Path</th> <th class="UnitDirectories-desktopSynopsis">Synopsis</th> </tr> <tr data-aria-controls="color-palette " class=""> <td data-id="color" data-aria-owns="color-palette "> <div class="UnitDirectories-pathCell"> <div><button type="button" class="go-Button go-Button--inline UnitDirectories-toggleButton" aria-expanded="false" aria-label="1 more from" data-aria-controls="color-palette " data-aria-labelledby="color-button color" data-id="color-button"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_right_gm_grey_24dp.svg" alt=""> </button><a href="/image/color@go1.24.2">color</a> </div> <div class="UnitDirectories-mobileSynopsis">Package color implements a basic color library.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package color implements a basic color library.</td></tr><tr data-id="color-palette" class=""> <td> <div class="UnitDirectories-subdirectory"> <span> <a href="/image/color/palette@go1.24.2">palette</a> </span> <div class="UnitDirectories-mobileSynopsis">Package palette provides standard color palettes.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package palette provides standard color palettes.</td></tr> <tr class=""> <td data-id="draw" data-aria-owns=""> <div class="UnitDirectories-pathCell"> <div><a href="/image/draw@go1.24.2">draw</a> </div> <div class="UnitDirectories-mobileSynopsis">Package draw provides image composition functions.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package draw provides image composition functions.</td></tr></tr> <tr class=""> <td data-id="gif" data-aria-owns=""> <div class="UnitDirectories-pathCell"> <div><a href="/image/gif@go1.24.2">gif</a> </div> <div class="UnitDirectories-mobileSynopsis">Package gif implements a GIF image decoder and encoder.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package gif implements a GIF image decoder and encoder.</td></tr></tr> <tr data-aria-controls="internal-imageutil " class="UnitDirectories-internal"> <td data-id="internal" data-aria-owns="internal-imageutil "> <div class="UnitDirectories-pathCell"> <div><button type="button" class="go-Button go-Button--inline UnitDirectories-toggleButton" aria-expanded="false" aria-label="1 more from" data-aria-controls="internal-imageutil " data-aria-labelledby="internal-button internal" data-id="internal-button"> <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_right_gm_grey_24dp.svg" alt=""> </button><span>internal</span> </td> <td class="UnitDirectories-desktopSynopsis"></td></tr><tr data-id="internal-imageutil" class="UnitDirectories-internal"> <td> <div class="UnitDirectories-subdirectory"> <span> <a href="/image/internal/imageutil@go1.24.2">imageutil</a> </span> <div class="UnitDirectories-mobileSynopsis">Package imageutil contains code shared by image-related packages.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package imageutil contains code shared by image-related packages.</td></tr> <tr class=""> <td data-id="jpeg" data-aria-owns=""> <div class="UnitDirectories-pathCell"> <div><a href="/image/jpeg@go1.24.2">jpeg</a> </div> <div class="UnitDirectories-mobileSynopsis">Package jpeg implements a JPEG image decoder and encoder.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package jpeg implements a JPEG image decoder and encoder.</td></tr></tr> <tr class=""> <td data-id="png" data-aria-owns=""> <div class="UnitDirectories-pathCell"> <div><a href="/image/png@go1.24.2">png</a> </div> <div class="UnitDirectories-mobileSynopsis">Package png implements a PNG image decoder and encoder.</div> </div> </td> <td class="UnitDirectories-desktopSynopsis">Package png implements a PNG image decoder and encoder.</td></tr></tr> </table> </div> </div> </div> <div id="showInternal-description" hidden> Click to show internal directories. </div> <div id="hideInternal-description" hidden> Click to hide internal directories. </div> </article> <footer class="go-Main-footer"></footer> </main> <footer class="go-Footer"> <div class="go-Footer-links"> <div class="go-Footer-linkColumn"> <a href="https://go.dev/solutions" class="go-Footer-link go-Footer-link--primary" data-gtmc="footer link"> Why Go </a> <a href="https://go.dev/solutions#use-cases" class="go-Footer-link" data-gtmc="footer link"> Use Cases </a> <a href="https://go.dev/solutions#case-studies" class="go-Footer-link" data-gtmc="footer link"> Case Studies </a> </div> <div class="go-Footer-linkColumn"> <a href="https://learn.go.dev/" class="go-Footer-link go-Footer-link--primary" data-gtmc="footer link"> Get Started </a> <a href="https://play.golang.org" class="go-Footer-link" data-gtmc="footer link"> Playground </a> <a href="https://tour.golang.org" class="go-Footer-link" data-gtmc="footer link"> Tour </a> <a href="https://stackoverflow.com/questions/tagged/go?tab=Newest" class="go-Footer-link" data-gtmc="footer link"> Stack Overflow </a> <a href="https://go.dev/help" class="go-Footer-link" data-gtmc="footer link"> Help </a> </div> <div class="go-Footer-linkColumn"> <a href="https://pkg.go.dev" class="go-Footer-link go-Footer-link--primary" data-gtmc="footer link"> Packages </a> <a href="/std" class="go-Footer-link" data-gtmc="footer link"> Standard Library </a> <a href="/golang.org/x" class="go-Footer-link" data-gtmc="footer link"> Sub-repositories </a> <a href="https://pkg.go.dev/about" class="go-Footer-link" data-gtmc="footer link"> About Go Packages </a> </div> <div class="go-Footer-linkColumn"> <a href="https://go.dev/project" class="go-Footer-link go-Footer-link--primary" data-gtmc="footer link"> About </a> <a href="https://go.dev/dl/" class="go-Footer-link" data-gtmc="footer link">Download</a> <a href="https://go.dev/blog" class="go-Footer-link" data-gtmc="footer link">Blog</a> <a href="https://github.com/golang/go/issues" class="go-Footer-link" data-gtmc="footer link"> Issue Tracker </a> <a href="https://go.dev/doc/devel/release.html" class="go-Footer-link" data-gtmc="footer link"> Release Notes </a> <a href="https://blog.golang.org/go-brand" class="go-Footer-link" data-gtmc="footer link"> Brand Guidelines </a> <a href="https://go.dev/conduct" class="go-Footer-link" data-gtmc="footer link"> Code of Conduct </a> </div> <div class="go-Footer-linkColumn"> <a href="https://www.twitter.com/golang" class="go-Footer-link go-Footer-link--primary" data-gtmc="footer link"> Connect </a> <a href="https://www.twitter.com/golang" class="go-Footer-link" data-gtmc="footer link"> Twitter </a> <a href="https://github.com/golang" class="go-Footer-link" data-gtmc="footer link">GitHub</a> <a href="https://invite.slack.golangbridge.org/" class="go-Footer-link" data-gtmc="footer link"> Slack </a> <a href="https://reddit.com/r/golang" class="go-Footer-link" data-gtmc="footer link"> r/golang </a> <a href="https://www.meetup.com/pro/go" class="go-Footer-link" data-gtmc="footer link"> Meetup </a> <a href="https://golangweekly.com/" class="go-Footer-link" data-gtmc="footer link"> Golang Weekly </a> </div> </div> <div class="go-Footer-bottom"> <img class="go-Footer-gopher" width="1431" height="901" src="/static/shared/gopher/pilot-bust-1431x901.svg" alt="Gopher in flight goggles"> <ul class="go-Footer-listRow"> <li class="go-Footer-listItem"> <a href="https://go.dev/copyright" data-gtmc="footer link">Copyright</a> </li> <li class="go-Footer-listItem"> <a href="https://go.dev/tos" data-gtmc="footer link">Terms of Service</a> </li> <li class="go-Footer-listItem"> <a href="http://www.google.com/intl/en/policies/privacy/" data-gtmc="footer link" target="_blank" rel="noopener"> Privacy Policy </a> </li> <li class="go-Footer-listItem"> <a href="https://go.dev/s/pkgsite-feedback" target="_blank" rel="noopener" data-gtmc="footer link"> Report an Issue </a> </li> <li class="go-Footer-listItem"> <button class="go-Button go-Button--text go-Footer-toggleTheme js-toggleTheme" aria-label="Theme Toggle"> <img data-value="auto" class="go-Icon go-Icon--inverted" height="24" width="24" src="/static/shared/icon/brightness_6_gm_grey_24dp.svg" alt="System theme"> <img data-value="dark" class="go-Icon go-Icon--inverted" height="24" width="24" src="/static/shared/icon/brightness_2_gm_grey_24dp.svg" alt="Dark theme"> <img data-value="light" class="go-Icon go-Icon--inverted" height="24" width="24" src="/static/shared/icon/light_mode_gm_grey_24dp.svg" alt="Light theme"> <p> Theme Toggle </p> </button> </li> <li class="go-Footer-listItem"> <button class="go-Button go-Button--text go-Footer-keyboard js-openShortcuts" aria-label="Shorcuts Modal"> <img class="go-Icon go-Icon--inverted" height="24" width="24" src="/static/shared/icon/keyboard_grey_24dp.svg" alt=""> <p> Shortcuts Modal </p> </button> </li> </ul> <a class="go-Footer-googleLogo" href="https://google.com" target="_blank"rel="noopener" data-gtmc="footer link"> <img class="go-Footer-googleLogoImg" height="24" width="72" src="/static/shared/logo/google-white.svg" alt="Google logo"> </a> </div> </footer> <dialog id="jump-to-modal" class="JumpDialog go-Modal go-Modal--md js-modal"> <form method="dialog" data-gmtc="jump to form" aria-label="Jump to Identifier"> <div class="Dialog-title go-Modal-header"> <h2>Jump to</h2> <button class="go-Button go-Button--inline" type="button" data-modal-close data-gtmc="modal button" aria-label="Close" > <img class="go-Icon" height="24" width="24" src="/static/shared/icon/close_gm_grey_24dp.svg" alt="" /> </button> </div> <div class="JumpDialog-filter"> <input class="JumpDialog-input go-Input" autocomplete="off" type="text"> </div> <div class="JumpDialog-body go-Modal-body"> <div class="JumpDialog-list"></div> </div> <div class="go-Modal-actions"> <button class="go-Button" data-test-id="close-dialog">Close</button> </div> </form> </dialog> <dialog class="ShortcutsDialog go-Modal go-Modal--sm js-modal"> <form method="dialog"> <div class="go-Modal-header"> <h2>Keyboard shortcuts</h2> <button class="go-Button go-Button--inline" type="button" data-modal-close data-gtmc="modal button" aria-label="Close" > <img class="go-Icon" height="24" width="24" src="/static/shared/icon/close_gm_grey_24dp.svg" alt="" /> </button> </div> <div class="go-Modal-body"> <table> <tbody> <tr><td class="ShortcutsDialog-key"> <strong>?</strong></td><td> : This menu</td> </tr> <tr><td class="ShortcutsDialog-key"> <strong>/</strong></td><td> : Search site</td> </tr> <tr><td class="ShortcutsDialog-key"> <strong>f</strong> or <strong>F</strong></td><td> : Jump to</td> </tr> <tr> <td class="ShortcutsDialog-key"><strong>y</strong> or <strong>Y</strong></td> <td> : Canonical URL</td> </tr> </tbody> </table> </div> <div class="go-Modal-actions"> <button class="go-Button" data-test-id="close-dialog">Close</button> </div> </form> </dialog> <section class="Cookie-notice js-cookieNotice"> <div>go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic. <a target=_blank href="https://policies.google.com/technologies/cookies">Learn more.</a></div> <div><button class="go-Button">Okay</button></div> </section> <script> // this will throw if the querySelector can鈥檛 find the element const gtmId = document.querySelector('.js-gtmID').dataset.gtmid; if (!gtmId) { throw new Error('Google Tag Manager ID not found'); } loadScript(`https://www.googletagmanager.com/gtm.js?id=${gtmId}`); </script> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W8MVQXG" height="0" width="0" style="display:none;visibility:hidden"> </iframe> </noscript> <div class="js-canonicalURLPath" data-canonical-url-path="/image@go1.24.2" hidden></div> <div class="js-playgroundVars" data-modulepath="std" data-version="v1.24.2" hidden></div> <script> loadScript('/static/frontend/unit/main/main.js') </script> <script> loadScript('/static/frontend/unit/unit.js') </script> </body> </html>