Ren'Py Last Image When Ending a Video

Impious Monk

Active Member
Game Developer
Oct 14, 2021
626
2,808
I'm using Ren'py to play a .webm video. Here is my definition for that and the code I use to play it:
Code:
image jamie = Movie(channel ="movie", play="images/s1_1/jamie.webm", loop=False, image="images/s1_1/jamie_end.png")
Code:
    scene 1-28a with dissolve
    $ renpy.pause()
    scene jamie
    $ renpy.pause()
    scene 1-31 with Dissolve(1)
The "jamie_end.png" is the last image of the 200 images that I used to create the video, so it should match the end of the video exactly.

Here is the image:

jamie_end.png

Notice that there are no issues with the windows in the background. This is exactly how the image appears when it is the last frame of the video.

But now see that when the image is shown in Ren'py by itself, not as part of the video, I'm getting Ren'py's background showing through.

png window.png

I've tried using a .jpg version instead, but you can see that the windows are still not consistent with the video version:

jpg window.png

As far as I can tell, there is no way in Ren'py to make the video freeze on the last frame of a video until the player clicks through. (If someone can show me differently, that would be great.) But if I can't get the photo to match the video, then I can't use this method, either.

Any suggestions?
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,380
8,652
Why not just open the original file in your editor and put a dark BG underneath the video and re-export/render it? Seems like it'd be a lot easier.

That said, I generally use this for animations. But any animtions I use tend to have looping in mind, so don't know if it'd apply to you:

Code:
image jlbj1 = Movie(play="images/ani/jlbj1.webm", loop=True, start_image="images/ani/jlbjmidani_060.png", image="images/ani/jlbjmidani_119")
You might be able to work in a bg, though I've never used it personally don't know how it'd work for this. You'll need to make yourself a 1080p black image (though I use 'scene black with fade' a fair bit, so that might work as well.), which should be easy enough.

Code:
image bg black = "images/bg_black.jpg

scene black
show jamie1_1 (or what ever the name you decided on is)
scene jamie_end with dissolve
hide jamie1_1
j "Blah blah Blah"
(continue with story)
 
Last edited:
  • Like
Reactions: Impious Monk

Impious Monk

Active Member
Game Developer
Oct 14, 2021
626
2,808
Why not just open the original file in your editor and put a dark BG underneath the video and re-export/render it? Seems like it'd be a lot easier.

That said, I generally use this for animations. But any animtions I use tend to have looping in mind, so don't know if it'd apply to you:

Code:
image jlbj1 = Movie(play="images/ani/jlbj1.webm", loop=True, start_image="images/ani/jlbjmidani_060.png", image="images/ani/jlbjmidani_119")
You might be able to work in a bg, though I've never used it personally don't know how it'd work for this. You'll need to make yourself a 1080p black image (though I use 'scene black with fade' a fair bit, so that might work as well.), which should be easy enough.

Code:
image bg black = "images/bg_black.jpg

scene black
show jamie1_1 (or what ever the name you decided on is)
scene jamie_end with dissolve
hide jamie1_1
j "Blah blah Blah"
(continue with story)
Wow, thanks man. I just threw the scene black in there, changed "scene jamie" to "show jamie" and voila. Two seconds to fix. I really appreciate it!
 
  • Like
Reactions: MissFortune

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,380
8,652
Wow, thanks man. I just threw the scene black in there, changed "scene jamie" to "show jamie" and voila. Two seconds to fix. I really appreciate it!
Awesome. Wasn't a 100% on that working well, tbh. :ROFLMAO:
 
  • Like
Reactions: Impious Monk

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,236
But now see that when the image is shown in Ren'py by itself, not as part of the video, I'm getting Ren'py's background showing through.
Ren'Py is only doing what asked, this mean that the image itself is at fault. For whatever reason, when you saved it the color of the board as been registered as being the color for transparency.

While MissFortune fix works, you should still try to understand why your image have this transparency setting, because it risk to happen again with others of your images.
 
  • Like
Reactions: MissFortune

Impious Monk

Active Member
Game Developer
Oct 14, 2021
626
2,808
Ren'Py is only doing what asked, this mean that the image itself is at fault. For whatever reason, when you saved it the color of the board as been registered as being the color for transparency.

While MissFortune fix works, you should still try to understand why your image have this transparency setting, because it risk to happen again with others of your images.
I believe I understand why the window shows through on the .png, because when I rendered those images I had "draw dome" turned off in Daz and therefore nothing behind the window (although I actually had a plane with an image on it placed outside the window--also turned off, stupidly, to speed up the set of 200 renders). Obviously, I didn't realize it at the time I did the renders, though.

I'm still not 100% on why the video version of the same .png images turned off the transparency. I did the images to video conversion through Photoshop. I'm assuming the answer is simply that .webm is not transparent.

But the thing that really puzzles me is why the .jpg version looks different (brighter) than the .webm version, since the .jpg should not be transparent.
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,380
8,652
But the thing that really puzzles me is why the .jpg version looks different (brighter) than the .webm version, since the .jpg should not be transparent.
.jpg files with no background (like your window in this case) will default to white, iirc. Hence why you see .png files for images that are supposed to stay transparent. Any particular reason you use Photoshop for animations over importing them as an image sequence into something like Premiere Pro (and fnord for the .webms)? Is it just comfort with Photoshop, or more of a cost thing? Just sorta curious.

I usually avoid windows like the plague in Daz (too easy to get a spotlight reflecting in one) which are annoying to get out in post if you miss it prior to rendering, so I usually always just toss in a dark/moonlit HDRI for any scene/animation I know is taking place at night. Has a nice bonus of nearly always avoiding situations like this. Forgot where it even came from, but works great.

 

Impious Monk

Active Member
Game Developer
Oct 14, 2021
626
2,808
.jpg files with no background (like your window in this case) will default to white, iirc. Hence why you see .png files for images that are supposed to stay transparent. Any particular reason you use Photoshop for animations over importing them as an image sequence into something like Premiere Pro (and fnord for the .webms)? Is it just comfort with Photoshop, or more of a cost thing? Just sorta curious.

I usually avoid windows like the plague in Daz (too easy to get a spotlight reflecting in one) which are annoying to get out in post if you miss it prior to rendering, so I usually always just toss in a dark/moonlit HDRI for any scene/animation I know is taking place at night. Has a nice bonus of nearly always avoiding situations like this. Forgot where it even came from, but works great.

Okay, that makes sense. The office asset I'm using for this scene does have windows all over so I'll have to really keep on eye on that since my VN will be coming back to this scene frequently. I'll check out the HDR. Thank you for that.

The only reason I went with Photoshop is because I didn't know how to do convert an image sequence into a video, and the clearest explanation I found online was a YouTube video from WP Guru, wherein he demonstrated the process using Photoshop. It was pretty simple, actually, since Photoshop does let you import the entire image sequence with one click and export it as a video.
 
  • Like
Reactions: MissFortune

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,380
8,652
Yeah, for sure. If you already have a system that works fine for you, there's no point messing with it. But if you ever decide to go the Premiere Pro (or After Effects) route later on for whatever reason, it's relatively simple.

Just have your images ordered correctly (image_60.png all the way to image_119. Again, all my numbers are based on looping animations, so it may change a bit.), go to File > Import > Select the first image, check the image sequence box and it should import all of it. Just drag it onto the timeline and make your edits. Then just export it. File > Export > Media (You'll need .) > Change your outputs as needed (I prefer VP9, but the diffrences are minimal.

 
  • Like
Reactions: Impious Monk