Day, sunset and night backgrounds in Ren'Py

How to put a three-time background set into a Ren'Py project, cut between the hours with a dissolve, and let one variable pick the right picture. Written against the Ren'Py 8.6 documentation.

Updated

Every scene in the library is a set: the same room from the same camera, at day, sunset and night. In a visual novel that lets you change the hour without the room moving. This guide covers where the files go, the few lines of script you need, a variable that chooses the time for you, and what to do when your project isn’t 1920×1080. The visual novel page has the short version.

Put the set in game/images

Download the set (.zip) from a scene page, for example Window-side classroom. Inside are three JPGs and a licence file:

bg window_side_classroom day.jpg
bg window_side_classroom sunset.jpg
bg window_side_classroom night.jpg
LICENSE.txt

Copy the JPGs into your project’s game/images/ folder. A subfolder such as game/images/backgrounds/ is fine: Ren’Py searches every folder under images, and the folder name does not become part of the image name. Keep LICENSE.txt with your project notes; Ren’Py ignores it either way.

Why you don’t need image statements

The Ren’Py documentation (Displaying Images, “Images Directory”) says that for a .jpg, .jpeg, .png, .webp, .avif or .svg file under images, “the extension is stripped, the rest of the filename is forced to lowercase, and the resulting filename is used as the image name if an image with that name has not been previously defined.”

So bg window_side_classroom day.jpg becomes the image bg window_side_classroom day, and this works with nothing else defined:

label start:
    scene bg window_side_classroom day
    "The last bell rang an hour ago."

The first word, bg, is the image’s tag. All three files share it, so a new background always replaces the old one. The place name is written with underscores so it stays one word. If you ever write your own image bg window_side_classroom day = ..., yours takes priority over the file.

Dissolve from one hour to the next

    scene bg window_side_classroom sunset with dissolve
    "Nobody came to collect the keys."

    scene bg window_side_classroom night with Dissolve(2.0)
    "Across the road, the flats lit up one window at a time."

dissolve takes 0.5 seconds. Dissolve(time) sets your own length; one to two seconds suits a change of hour.

The window-side classroom split into three vertical bands: the left band at day with blue sky, the middle at sunset in orange light, the right at night in blue shadow. Desks, windows and the chalkboard continue across the joins.
One scene, three files. The joins fall on the same desks because the camera never moved.

A dissolve between two unrelated pictures reads as a cut to somewhere else. Between two pictures of the same desks, the outlines stay put while only the colour and shadows move, so it reads as the same room, later. That only works if the edges line up, which is why each set is generated once and relit for the other times instead of being painted three times. How we do that, and where it still slips, is in Day, sunset and night that match.

scene clears the whole layer, sprites included. If characters are on screen and you only want the light to change, use show instead: because the tag bg is already showing, the new picture replaces the old background where it is, and the sprites stay.

    show bg window_side_classroom night with dissolve

Let a variable choose the time

Once a story has more than a few locations, writing the time into every scene line gets tedious and easy to get wrong. Keep the time in one variable and build the image name from it:

default time_of_day = "day"

init python:
    def bg(place):
        name = "bg {} {}".format(place, time_of_day)
        if not renpy.has_image(name):
            name = "bg {} day".format(place)
        return name

label start:
    scene expression bg("window_side_classroom")
    "Lunch break."

    $ time_of_day = "sunset"
    scene expression bg("window_side_classroom") with dissolve
    "Club activities ran late."

    $ time_of_day = "night"
    scene expression bg("school_rooftop") with dissolve
    "The door to the roof wasn't locked."

scene expression takes any expression that gives an image name. A string with no dot in it is read as the name of an image, so bg("school_rooftop") at night returns "bg school_rooftop night" and Ren’Py finds the file from the rooftop set. Because the variable is declared with default, it is saved with the game, and a loaded save comes back at the right hour. The has_image check falls back to the day picture when a place has no file for the current time, which matters once you add rain or snow for some places only.

Ren’Py also has dynamic images ("bg window_side_classroom [time_of_day]") and ConditionSwitch. Both re-check the variable at the start of every interaction, so the picture changes on the next line after the variable does. The explicit scene line above keeps the change, and its transition, where you wrote it.

If your project isn’t 1920×1080

When you create a project, the Ren’Py launcher offers 1280×720, 1920×1080, 2560×1440, 3840×2160 or a custom size, and calls 1920×1080 “a reasonable compromise”. It is the default, and at that size the backgrounds fill the screen as they are.

In a 1280×720 project, Ren’Py does not shrink a bigger picture to fit. The default placement centres an image horizontally and aligns it to the bottom of the screen, so you would see only the bottom middle of the room. Either resize the files to 1280×720 before they go into images (on a Mac, sips -Z 1280 *.jpg in a folder of copies does it in place), or scale them in the script:

transform fit_screen:
    xysize (config.screen_width, config.screen_height)

label start:
    scene bg window_side_classroom day at fit_screen

Resizing the files is the better choice: the game gets smaller and the picture looks the same.

For a 2560×1440 or 3840×2160 project, scaling a 1920 picture up makes it soft. Studio can produce any library scene at 4K (3840×2160). To change an existing project’s size, the launcher’s “Change/Update GUI” asks again, but it overwrites most GUI images and gui.rpy, so back them up first.

Sprites and the floor

The scenes are framed at eye level, with the lower middle left open: floor, an aisle, a path. Ren’Py’s left, center and right positions all align to the bottom of the screen, so a full-height sprite drawn with its feet at the bottom of its canvas stands on that floor in front of the furniture.

The back of a classroom at day, looking towards the chalkboard. Two tall rounded outlines on the left and right of the open aisle show where standing sprites would go.
Where sprites stand: the aisle and floor in the lower middle are left clear.

Two things help a sprite look as if it is in the room. Put its eye line near the background’s horizon (the camera height), since an eye-level camera sees a standing person’s eyes at about that line. And match the light: a sprite shaded for daylight looks pasted onto a night room. A tint per time is a cheap fix:

transform night_tint:
    matrixcolor TintMatrix("#9aa3c8")

label night_scene:
    scene bg window_side_classroom night
    show hana at center, night_tint

Replace hana with your own sprite’s tag. Pick the tint colour from the background itself; the colour chips on each scene page give its five main colours.

Rain, snow, phone and 4K

The library has day, sunset and night. For rain or snow in the same place, a vertical 9:16 crop or a 4K file, open the scene in Studio and choose what to change; it keeps the composition. Name what you get the same way, for example bg window_side_classroom rain.jpg, and the bg() function above picks it up when time_of_day is "rain".

Before you submit to a jam or a store

Every image here is AI-generated. The licence lets you use them in games you sell, without credit. Platforms and jams have their own rules: some jams ban AI-generated assets, Steam asks you to disclose them, and itch.io has a disclosure field. Using AI backgrounds commercially goes through what each one says.

In the library

Scenes this guide talks about, as full sets. Free at 1920×1080.

Try it in Studio

This prompt, filled in. Change the place, the hour or the light and paint your own.

An empty school corridor after club activities, lockers along the left wall, windows on the right, eye-level view, floor clear in the middle

Open in Studio with this prompt

Other guides

  1. Classroom by Dreamina 5.0: soft painted light through tall windows, curtains blowing, a school bag on a chair, the room tinted blue-violet

    One prompt, six image models: which paints anime backgrounds best

    In November 2026 we sent the same classroom prompt to six image models and set the pictures side by side, with what each one cost us. The free one held its own.
  2. A narrow aisle between dark bookshelves opening onto a reading table under an arched window, a bright patch of sun on the table and floor

    How to write a prompt for an anime background with no one in it

    The rules we now write every library scene by, each next to the picture it changed. Every prompt on this page was sent exactly as shown, to Dreamina 5.0 at 2K.
  3. A school rooftop after a thunderstorm, a huge storm cloud lit orange and pink above the town, puddles on the wet concrete mirroring it, a folding umbrella left by a puddle

    Why AI anime backgrounds look flat

    Our first 424 library scenes were made under house rules that caused six problems, each shown here on a picture of ours. The model was not the cause: the same model painted the better pictures.
  4. A small wooden railway shelter on a cliff above the sea, the sun setting straight ahead and the rails burning gold

    One background in day, sunset and night, without the room moving

    Every scene in our library is one picture, relit twice. This is how we do it with an image model, the sentences we send, and the four things that go wrong.
  5. The streaming lounge at day: bright sky in the window, sofa and bookshelf on the left, a desk with two monitors on the right.

    A background behind your VTuber model in OBS

    Canvas, layer order, getting the model in with a transparent background, switching from day to night with a fade, and making the model and the room look lit by the same light.
  6. A one-room apartment at sunset: a bed, a low table, a small kitchen counter and a balcony door with orange light coming in.

    Using AI-generated backgrounds commercially

    Whether you may use an AI background in a game you sell is two questions: what the image's licence allows, and what stores, jams and copyright law say about AI-made material. Sources read on 29 November 2026.