I'm trying to make a 5-year timelapse of monthly NDVI composites. I apply a Hollstein mask, make composites and fill the masked area with mean NDVI pixels of the entire timeperiod. Of course this method is questionable, and there are many ways, but I am mostly stuck on producing the timelapse video itself. I use the GIF production because I only use one band. In GEE my composites look like this: enter image description here But when I produce a GIF timelapse, it looks like this: enter image description here

I tried multiplying the NDVI by 100 to see whether that would induce more colour contrast, I tried to add more colours to the visualisation parameters, but the contrast remains the same.

Code: https://code.earthengine.google.com/dd50d25333a7ff8be05f76733bac6c3c


There are 2 bugs in your code:

  1. imgColMeanFilled has a dynamic range from -100 to 100. It is -100 to 100 because on line 25, you multiply the NDVI output by 100. However, to visualize the gif you have set the range from -1 to 1 which clips most of the image's range. Set it to -100 to 100 inside visParams on line 110.
  2. On line 103 you are multiplying an image with a range of -100 to 100 by 512. That makes the range -51200,51200. But then you convert it to unsigned 8 bit integer that has a range from 0 to 255. This results in the values getting clipped to 0 and 255. Instead, do not convert to unsigned integer.

With that, the result is as expected in gif. Link to corrected code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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