{"id":13582954,"url":"https://github.com/aazuspan/geeSharp","last_synced_at":"2025-04-06T18:31:41.217Z","repository":{"id":55638838,"uuid":"304981975","full_name":"aazuspan/geeSharp","owner":"aazuspan","description":"Pan-sharpening in the Earth Engine code editor","archived":false,"fork":false,"pushed_at":"2023-01-21T00:31:59.000Z","size":1092,"stargazers_count":43,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T00:22:53.425Z","etag":null,"topics":["earth-engine","ergas","gram-schmidt","image-processing","image-quality","landsat","pan-sharpening","panchromatic","pansharpening","pca","remote-sensing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aazuspan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-17T22:43:55.000Z","updated_at":"2025-02-28T12:55:54.000Z","dependencies_parsed_at":"2023-02-12T07:00:29.856Z","dependency_job_id":null,"html_url":"https://github.com/aazuspan/geeSharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2FgeeSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2FgeeSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2FgeeSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2FgeeSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aazuspan","download_url":"https://codeload.github.com/aazuspan/geeSharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247530921,"owners_count":20953872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earth-engine","ergas","gram-schmidt","image-processing","image-quality","landsat","pan-sharpening","panchromatic","pansharpening","pca","remote-sensing"],"created_at":"2024-08-01T15:03:09.311Z","updated_at":"2025-04-06T18:31:40.902Z","avatar_url":"https://github.com/aazuspan.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JavaScript API"],"sub_categories":["Repositories"],"readme":"# geeSharp\n\n[![Earth Engine Javascript](https://img.shields.io/badge/Earth%20Engine%20API-Javascript-red)](https://developers.google.com/earth-engine/tutorials/tutorial_api_01)\n[![Open in Code Editor](https://img.shields.io/badge/Open%20in-Code%20Editor-9cf)](https://code.earthengine.google.com/f08d3e4265bf0e502dacca76668d1914)\n\nPan-sharpen multispectral imagery in the [Google Earth Engine](https://earthengine.google.com/) Code Editor with one line of code:\n\n```javascript\nvar sharp = geeSharp.sharpen(img.select([\"B4\", \"B3\", \"B2\"]), img.select(\"B8\");\n```\n\n\u003cimg src=\"assets/demo.gif\" width=\"800px\"/\u003e\n\n\n## Usage\n### Pan-sharpening\n\nTo pan-sharpen an image, separate the lower resolution multispectral bands and the higher resolution panchromatic band into two images and pass them to the `geeSharp.sharpen` function. For example:\n\n```javascript\n// Import the geeSharp module\nvar geeSharp = require(\"users/aazuspan/geeSharp:geeSharp\");\n\n// Load an example Landsat 8 TOA image to sharpen\nvar img = ee.Image(\"LANDSAT/LC08/C01/T1_TOA/LC08_047027_20160819\");\n\n// Select the 30 m spectral bands to sharpen\nvar ms = img.select([\"B4\", \"B3\", \"B2\"]);\n// Select the 15 m panchromatic band\nvar pan = img.select([\"B8\"]);\n\n// Pan-sharpen!\nvar sharpened = geeSharp.sharpen(ms, pan);\n```\n\nBy default, pansharpening in `geeSharp` uses the Smoothing Filter-based Intensity Modulation (SFIM) algorithm because it is fast and produces consistent, high-quality results. However, you may want to experiment with other methods. You can do that by passing an algorithm name to the `sharpen` function.\n\n```javascript\nvar method = \"brovey\";\nvar sharpened = geeSharp.sharpen(ms, pan, method);\n```\n\nMost sharpening functions just require the unsharpened multispectral bands and the high-resolution panchromatic band as inputs, but some algorithms (like Gram-Schmidt) may accept other parameters. You can add those parameters after the method name when calling `sharpen`.\n\n```javascript\n// The Gram-Schmidt algorithm may require additional parameters depending on the size of your image.\nvar method = \"GS\";\nvar geom = ee.Geometry.Point([-122.41676185101713, 47.26851080476613]).buffer(1000);\nvar scale = 30;\nvar maxPixels = 1e13;\n\nvar sharpened = geeSharp.sharpen(ms, pan, method, geom, scale, maxPixels);\n```\n\nPrint `geeSharp.methods` for a full list of supported algorithms, and see the [documentation](https://github.com/aazuspan/geeSharp.js/wiki/Sharpening-Functions) for descriptions.\n\n### Image quality assessment\n\nImage quality metrics measure the distortion between a reference image and an image that has been modified, such as a pan-sharpened image. \n\n```javascript\n// Choose a metric\nvar metric = \"RMSE\";\n// Reproject the unsharpened image to the sharpened resolution\nvar reproj = unsharpened.resample(\"bicubic\").reproject(sharpened.projection());\n// Calculate the metric\nvar quality = geeSharp.quality(reproj, sharpened, metric);\n```\n\n\u003e **Warning**  \n\u003e Metrics are affected by spatial resolution, so when comparing unsharpened and pan-sharpened images, **always resample and reproject** the unsharpened image to high resolution first to ensure an accurate comparison!\n\nMost quality metrics just require an unmodified and a modified image and return a dictionary mapping band names to metric values, but some metrics require other parameters (e.g. `ERGAS` requires the high and low spectral resolution) and some return a single image-wise value (e.g. `RASE` and `ERGAS`). Print `geeSharp.metrics` for a full list of supported metrics and see the [documentation](https://github.com/aazuspan/geeSharp.js/wiki/Image-Quality-Metrics) for descriptions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2FgeeSharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faazuspan%2FgeeSharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2FgeeSharp/lists"}