How to Set a Real-Time Photo of Earth as Your Desktop Background

Joel Lee 17-06-2016

A few months back, a user on Reddit created a PowerShell script (learn more about PowerShell Command Prompt vs. Windows PowerShell: What's the Difference? Windows users can get by without using either the Command Prompt or PowerShell. But with Windows 10 and new features around the corner, maybe it's about time we learned. Read More ) that takes a near real-time image of the Earth from space and changes your desktop wallpaper whenever the image updates.


The images are sourced from the Himawari-8 weather satellite, which provides a public stream of snapshots. The scraped image is saved to /My Pictures/Himawari/ prior to being set as the new desktop background.

To download the script:

  • Visit this Github page.
  • Click Download ZIP.
  • Extract the ZIP file to find the himawari.ps1 script.
  • Move the script to a secure location.


The script is provided for all to use, but you’ll have to set up a scheduled task that periodically runs the script (learn more about Windows Task Scheduler 4 Boring Tasks You Can Automate With the Windows Task Scheduler Your time is too valuable to be wasted with repetitive tasks. Let us show you how to automate and schedule tasks. We have a few great examples, too. Read More ).

  • Launch the Task Scheduler app.
  • Under Action, select Create Task…
  • Enter a Name, such as “Earth Wallpaper Script”.
  • Select Run only when user is logged on.
  • Select Run with highest privileges.
  • Switch to Triggers tab.
  • Click New.
  • For Begin the Task, select At log on.
  • For Repeat Task Every, select 10 minutes for a duration of Indefinitely.
  • Click OK.
  • Switch to Actions tab.
  • Click New.
  • Browse and select the hiwamari.ps1 script.
  • Click OK.
  • Click OK again.

A bit complicated but that’s it. The next time you restart, the script should start and repeat every 10 minutes, updating your wallpaper every time. For laptops, beware that this could increase overall battery drain How to Optimize Windows 10 for Battery Life Battery life is a pretty important factor for mobile devices. While Windows 10 does offer new features to manage power settings, the defaults are not necessarily contributing to optimal battery life. Time to change that. Read More . You can also set it as your wallpaper How to Set the ISS's Earth Live Feed as Your Screensaver The International Space Station provides a 24/7 live feed of its view over Earth -- and with very little effort, you can set that video feed as your screensaver on Windows. Here's how. Read More !


Update: If the above doesn’t work and the script just opens up in Notepad, scroll down to the comments and read the PowerShell-related instructions by Dan.

PowerShell can do a lot of other cool stuff. Get started with these basic PowerShell commands 6 Basic PowerShell Commands to Get More out of Windows PowerShell is what you get when you give steroids to the Windows Command Prompt. It grants you control of nearly every aspect of the Windows system. We help you leap up its learning curve. Read More and try running these clever Windows 10 commands for PowerShell 3 Clever PowerShell Functions After Upgrading to Windows 10 Windows 10 brings us a new PowerShell, essentially Command Prompt on steroids. This article shows you how to do the otherwise impossible with PowerShell. And it's easier than you think! Read More .

Will you be doing this? Got any other cool PowerShell tricks? Share with us down in the comments below!

Related topics: PowerShell, Wallpaper, Windows 10.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Steve
    June 18, 2016 at 9:32 pm

    You might want to mention the view is of Australia, East Asia. Not so good for Americas.

  2. Anonymous
    June 17, 2016 at 8:58 pm

    Hey, the scheduled task doesn't work for me as configured. I had to enter "PowerShell" without quotes in the Program/script field. I then added ".\himawari.ps1" as an argument, and pointed the "Start in" field to my PS scripts folder.

    Until I did that it would just open the script in Notepad when it was time to run it.

    • Matt
      June 18, 2016 at 9:20 pm

      i`m getting the same result, can you give us a more detailed description of how you fixed it, for us novices. PowerShell in the Program/script field ? wheres is that exactly ? and where is PS scripts folder located etc. thanks

      • Anonymous
        June 18, 2016 at 11:46 pm

        No problem. First off make sure your system is allowed to run PS scripts... open PowerShell and type: Set-ExecutionPolicy RemoteSigned

        Then, in your scheduled task, open the "Actions" tab and edit your action. It should be set to "Start a Program".
        In the "Program/Script" field type "PowerShell" without quotes. No need to hit the Browse button.
        In the "Add arguments" field type ".\himawari.ps1" without quotes.
        In the "Start in" field just type the full path of the location where you saved the script.

        • Matt
          June 19, 2016 at 3:49 am

          Thanks, that did something , but all i`m getting is a black desktop background image , no earth image , do i need to restart pc or is something to do with the image time ?

        • Joel Lee
          June 19, 2016 at 3:51 am

          Thanks for such a clean breakdown, Dan! I'll amend the post to say that this can be an issue and point readers to your comment for more info.

        • Matt
          June 19, 2016 at 5:15 am

          i restarted pc, still a black screen with , taskeng.exe window pops up and runs the script and getting a message "remote server returned an error 404 not found" any ideas ?

        • zibi
          July 15, 2017 at 10:51 am

          It doesnt work for me. After going through the article All I got was a pop up notepad. After implementing Your suggestions I get not action at all :/

        • Zibi
          July 15, 2017 at 1:14 pm

          got it to work :) thx

  3. Anonymous
    June 17, 2016 at 2:23 pm

    Big ups for this, it looks great. Regarding battery drain, new tasks have enabled by default the option "Stop if the computer switches to battery power". You can verify this setting on the "Conditions" tab.

    • Joel Lee
      June 19, 2016 at 3:51 am

      Awesome, that's good to know. Thanks a lot, Dan. :)

    • Jack
      July 9, 2017 at 11:11 pm

      Hey mate I am getting black wallpaper. any solution ?

      ts = New-TimeSpan -Hours -2 -Minutes -30 #Number of hours and minutes to add/subtract to the date. Adjust this to offset your system date to around about GMT (I think?)
      $now = ((Get-Date -Second 00) + $ts)
      $now = $now.AddMinutes(-($now.minute % 10))

      $width = 550
      $level = "4d" #Level can be 4d, 8d, 16d, 20d
      $numblocks = 4 #this apparently corresponds directly with the level, keep this exactly the same as level without the 'd'
      $time = $now.ToString("HHmmss")
      $year = $now.ToString("yyyy")
      $month = $now.ToString("MM")
      $day = $now.ToString("dd")

      #Create the folder My Pictures\Himawari\ if it doesnt exist
      $outpath = [Environment]::GetFolderPath("MyPictures") + "\Himawari\"
      if(!(Test-Path -Path $outpath ))
      [void](New-Item -ItemType directory -Path $outpath)

      #The filename that will be saved:
      #Uncomment this to have the files accumulate in the directory:
      #$outfile = "$year$month$day"+"_" + $time + ".jpg"
      #Use this to have the script just store the latest file only:
      $outfile = "latest.jpg"

      $url = "$level/$width/$year/$month/$day/$time"


      $image = New-Object System.Drawing.Bitmap(($width * $numblocks), ($width * $numblocks))
      $graphics = [System.Drawing.Graphics]::FromImage($image)

      for ($y = 0; $y -lt $numblocks; $y++)
      for ($x = 0; $x -lt $numblocks; $x++)
      $thisurl = $url + "_" + [String]$x + "_" + [String]$y + ".png"
      Write-Output "Downloading: $thisurl"


      $request = [System.Net.WebRequest]::create($thisurl)
      $response = $request.getResponse()
      $HTTP_Status = [int]$response.StatusCode
      If ($HTTP_Status -eq 200)
      $imgblock = [System.Drawing.Image]::fromStream($response.getResponseStream())
      $graphics.DrawImage($imgblock,($x*$width),($y*$width) , $width, $width)
      $ErrorMessage = $_.Exception.Message
      $FailedItem = $_.Exception.ItemName
      Write-Output "Failed! $ErrorMessage with $FailedItem"

      $qualityEncoder = [System.Drawing.Imaging.Encoder]::Quality
      $encoderParams = New-Object System.Drawing.Imaging.EncoderParameters(1)

      # Set JPEG quality level here: 0 - 100 (inclusive bounds)
      $encoderParams.Param[0] = New-Object System.Drawing.Imaging.EncoderParameter($qualityEncoder, 90)
      $jpegCodecInfo = [System.Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | where {$_.MimeType -eq 'image/jpeg'}

      $$outpath + $outfile), $jpegCodecInfo, $encoderParams)

      Write-Output "Setting Wallpaper..."
      Set-ItemProperty -path "HKCU:Control Panel\Desktop" -name Wallpaper -value ($outpath + $outfile)
      Set-ItemProperty -path "HKCU:Control Panel\Desktop" -name WallpaperStyle -value 6
      Set-ItemProperty -path "HKCU:Control Panel\Desktop" -name TileWallpaper -value 0
      Set-ItemProperty 'HKCU:\Control Panel\Colors' -name Background -Value "0 0 0"
      #rundll32.exe user32.dll, UpdatePerUserSystemParameters

      $setwallpapersource = @"
      using System.Runtime.InteropServices;
      public class wallpaper
      public const int SetDesktopWallpaper = 20;
      public const int UpdateIniFile = 0x01;
      public const int SendWinIniChange = 0x02;
      [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
      private static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni);
      public static void SetWallpaper ( string path )
      SystemParametersInfo( SetDesktopWallpaper, 0, path, UpdateIniFile | SendWinIniChange );
      Add-Type -TypeDefinition $setwallpapersource
      [wallpaper]::SetWallpaper(($outpath + $outfile))

      Write-Output "Done"