Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.Image.neighborhoodToBands
Stay organized with collections
Save and categorize content based on your preferences.
Turns the neighborhood of a pixel into a set of bands. The neighborhood is specified using a Kernel and only non-zero-weight kernel values are used. The weights of the kernel is otherwise ignored.
Each input band produces x * y output bands. Each output band is named 'input_x_y' where x and y indicate the pixel's location in the kernel. For example, a 3x3 kernel operating on a 2-band image produces 18 output bands.
Usage | Returns | Image.neighborhoodToBands(kernel) | Image |
Argument | Type | Details | this: image | Image | The image to get pixels from. |
kernel | Kernel | The kernel specifying the neighborhood. Zero-weight values are ignored. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-19 UTC.
[null,null,["Last updated 2024-09-19 UTC."],[[["\u003cp\u003eTransforms image pixels by considering their neighboring pixels defined by a kernel.\u003c/p\u003e\n"],["\u003cp\u003eGenerates multiple output bands for each input band, representing the pixel values within the kernel's neighborhood.\u003c/p\u003e\n"],["\u003cp\u003eThe output bands are named based on the input band and the pixel's position in the kernel.\u003c/p\u003e\n"],["\u003cp\u003eKernel weights are only used to define the neighborhood, their actual values are not used in the calculation.\u003c/p\u003e\n"]]],[],null,["# ee.Image.neighborhoodToBands\n\nTurns the neighborhood of a pixel into a set of bands. The neighborhood is specified using a Kernel and only non-zero-weight kernel values are used. The weights of the kernel is otherwise ignored.\n\n\u003cbr /\u003e\n\nEach input band produces x \\* y output bands. Each output band is named 'input_x_y' where x and y indicate the pixel's location in the kernel. For example, a 3x3 kernel operating on a 2-band image produces 18 output bands.\n\n| Usage | Returns |\n|-------------------------------------|---------|\n| Image.neighborhoodToBands`(kernel)` | Image |\n\n| Argument | Type | Details |\n|---------------|--------|-------------------------------------------------------------------------|\n| this: `image` | Image | The image to get pixels from. |\n| `kernel` | Kernel | The kernel specifying the neighborhood. Zero-weight values are ignored. |"]]