{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\"Open\n", "\n", "Uncomment the following line to install [geemap](https://geemap.org) if needed." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# !pip install geemap" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import ee\n", "import geemap" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Add fading effect to existing GIF." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "url = \"https://i.imgur.com/ZWSZC5z.gif\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.show_image(url, verbose=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "out_gif = \"gif_fading.gif\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.gif_fading(url, out_gif, verbose=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.show_image(out_gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](https://i.imgur.com/PbK89b6.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a timelapse from scratch and add fading effect." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()\n", "Map.add_basemap(\"HYBRID\")\n", "Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Sierra Gorda and Spence copper mines, Chile" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "roi = ee.Geometry.Polygon(\n", " [\n", " [\n", " [-69.315491, -22.837104],\n", " [-69.315491, -22.751488],\n", " [-69.190006, -22.751488],\n", " [-69.190006, -22.837104],\n", " [-69.315491, -22.837104],\n", " ]\n", " ]\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map.addLayer(roi, {}, \"ROI\")\n", "Map.centerObject(roi)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "title = \"Sierra Gorda copper mines, Chile\"\n", "out_gif = \"timelapse.gif\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.landsat_timelapse(\n", " roi,\n", " out_gif,\n", " start_year=2004,\n", " end_year=2010,\n", " frames_per_second=1,\n", " title=title,\n", " fading=False,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.show_image(out_gif)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "out_fading_gif = \"timelapse_fading.gif\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.landsat_timelapse(\n", " roi,\n", " out_fading_gif,\n", " start_year=2004,\n", " end_year=2010,\n", " frames_per_second=1,\n", " title=title,\n", " fading=True,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.show_image(out_fading_gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](https://i.imgur.com/B4eK6Yn.gif)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }