



Now, Google Earth's latest update to "Timelapse" gives viewers a glimpse into the past, allowing them to watch landscapes evolve from 1984 to 2016. A lot has changed in the past 32 years: average yearly temperatures increased, glacier have retreated and nearly three billion more people wander the planet’s surface. x must be within ) elif isinstance ( overlay_data, ee. delta = 10 xy = ( gif_width - image_resize - delta, gif_height - image_resize - delta ) # xy = (int(0.05 * gif_width), int(0.05 * gif_height)) elif ( xy is not None ) and ( not isinstance ( xy, tuple )) and ( len ( xy ) = 2 ): print ( "xy must be a tuple, e.g., (10, 10), ('10%', '10%')" ) return elif all ( isinstance ( item, int ) for item in xy ) and ( len ( xy ) = 2 ): x, y = xy if ( x > 0 ) and ( x 0 ) and ( y < gif_height ): pass else : print ( "xy is out of bounds. copy () if xy is None : # default logo location is 5% width and 5% height of the image. ellipse (( 0, 0, image_size, image_size ), fill = 255 ) if has_transparency ( logo_raw_image ): mask_im = logo_image. new ( "L", image_size, 0 ) draw = ImageDraw. size mask_im = None if circle_mask : mask_im = Image. ANTIALIAS ) gif_width, gif_height = gif. size ratio = max ( logo_raw_size / image_size, logo_raw_size / image_size, ) image_resize = ( int ( logo_raw_size / ratio ), int ( logo_raw_size / ratio )) image_size = min ( logo_raw_size, image_size ), min ( logo_raw_size, image_size ) logo_image = logo_raw_image. open ( in_image ) except Exception as e : print ( e ) logo_raw_size = logo_raw_image. abspath ( in_image ) logo_raw_image = Image. startswith ( "http" ): logo_raw_image = open_image_from_url ( in_image ) else : in_image = os. open ( in_gif ) except Exception as e : print ( "An error occurred while opening the image." ) print ( e ) return logo_raw_image = None try : if in_image. exists ( in_image )): print ( "The provided logo file does not exist." ) return out_dir = check_dir (( os. exists ( in_gif ): print ( "The input gif file does not exist." ) return if ( not is_url ) and ( not os. startswith ( "http" ): is_url = True if not os. abspath ( in_gif ) is_url = False if in_image. """ # import io import warnings from PIL import Image, ImageDraw, ImageSequence warnings. circle_mask (bool, optional): Whether to apply a circle mask to the image. image_size (tuple, optional): Resize image. xy (tuple, optional): Top left corner of the text. in_image (str): Input file path to the image. out_gif (str): Output file path to the GIF image. Args: in_gif (str): Input file path to the GIF image. Def add_image_to_gif ( in_gif, out_gif, in_image, xy = None, image_size = ( 80, 80 ), circle_mask = False ): """Adds an image logo to a GIF image.
