I am trying to pan sharpen "Planet SkySat Public Ortho Imagery, Multispectral" image but it has been returning blank tiles. What is the problem?

var imageCollection = ee.ImageCollection('SKYSAT/GEN-A/PUBLIC/ORTHO/MULTISPECTRAL');
var image = imageCollection.median();

var vis = {
  "bands": ["N","G","B"],

print (image,"original image")
Map.addLayer(image,vis,'Original Image')

// Convert the RGB bands to the HSV color space.
var hsv = image.select(['N', 'G', 'B']).rgbToHsv();
print (hsv,"HSV");

// Swap in the panchromatic band and convert back to RGB. P is panchromatic band
//ee.Image.cat concatenates the images 
var sharpened = ee.Image.cat([
  hsv.select('hue'), hsv.select('saturation'), image.select('P')]).hsvToRgb();

var visPan = {


Map.setCenter(85.456, 27.345,8);
  • Thanks a lot. It worked. I changed this var hsv = image.select(['R', 'G', 'B']).unitScale(16,62000).rgbToHsv(); for testing purpose. Sorry for repetitive question as I am new to GEE. How can I have values of (min,max) to feed in .unitScale(min,max)?
    – polymathic
    Commented Jun 6, 2021 at 9:11
  • gis.stackexchange.com/a/306964/2856
    – user2856
    Commented Jun 6, 2021 at 10:08
  • Thank you @user2856
    – polymathic
    Commented Jun 8, 2021 at 16:23

1 Answer 1


ee.Image.rgbToHsv expects a 3 band image in the range [0, 1]. The Skysat imagery is not in this range (see estimated min/max values). Use ee.Image.unitScale to rescale/normalise to a 0-1 range.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.