Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del 15 aprile 2025 devono verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Sottrae il secondo valore dal primo per ogni coppia di bande corrispondenti in image1 e image2. Se image1 o image2 ha una sola banda, questa viene confrontata con tutte le bande dell'altra immagine. Se le immagini hanno lo stesso numero di bande, ma non gli stessi nomi, vengono utilizzate a coppie nell'ordine naturale. Le bande di output prendono il nome dell'input più lungo o, se hanno la stessa lunghezza, nell'ordine di image1. Il tipo di pixel di output è l'unione dei tipi di input.
Utilizzo
Resi
Image.subtract(image2)
Immagine
Argomento
Tipo
Dettagli
questo: image1
Immagine
L'immagine da cui vengono prese le bande dell'operando di sinistra.
image2
Immagine
L'immagine da cui vengono prese le bande dell'operando di destra.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[[["`subtract()` subtracts the pixel values of two images, band-by-band."],["It handles single-band images and multi-band images with potentially different band names."],["Output band names and pixel type are determined based on the input images."],["The function returns a new `Image` object representing the result of the subtraction."],["This method is useful for various image processing tasks like change detection or calculating spectral indices."]]],["The `subtract` method computes the difference between two images (`image1` and `image2`). It subtracts corresponding bands pairwise. If one image has a single band, it's subtracted from all bands of the other image. When images have different band names but the same count, they're matched in order. Output bands are named after the longer input's band names, with the pixel type as a union of the input types. The code also gives examples of usage with `add`, `multiply`, `divide`, `mod`, and `pow`.\n"]]