I am creating a composite image of Landsat 8 OLI of Okinawa and want to export the true color image to my google drive as a tif file. I was able to successfully download it, but the image (img2) looks very different than what was rendered on my screen (img1). Could someone let me know what I might be doing wrong?
function maskL8sr(image) {
// Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = 1 << 3;
var cloudsBitMask = 1 << 5;
// Get the pixel QA band.
var qa = image.select('pixel_qa');
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
// Return the masked image, scaled to TOA reflectance, without the QA bands.
return image.updateMask(mask).divide(10000)
.select("B[0-9]*")
.copyProperties(image, ["system:time_start"]);
}
// Map the function over one year of data.
var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterDate('2017-01-01', '2018-09-09')
.map(maskL8sr)
var composite = collection.median();
Map.setCenter(127.954828,26.495070);
// Display the results.
Map.addLayer(composite, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.3});
// Create a geometry representing an export region.
var geometry = ee.Geometry.Rectangle([126.551513671875,26.03704188651584,128.86962890625,27.518015241965667]);
// Export the image, specifying scale and region.
Export.image.toDrive({
image: composite,
description: 'OkinawaLandsat2018',
scale: 30,
region: geometry,
fileFormat: 'GeoTIFF'
});