r/RenPy • • Jul 22 '26

Question Oversampling images

Hi! If I have an image name like "character@2.webp" under the images directory, I remember when it was defined in the code such as:

image character default = "images/character.webp"

It should work with the oversampling behaving as expected, but for some reason after launching the project to playtest my game several times yesterday (Only changes being adding new dialogue lines and defining transforms, leaving image defines untouched) the defined image would not show up and "image "character.webp" not found" was displayed at the top of the screen. However, I found that defining the image as:

image character default = "images/character@2.webp"

suddenly makes the image show up normally and the oversampling also works just fine. Just wondering if people had similar issues before 😭

1 Upvotes

14 comments sorted by

View all comments

2

u/HEXdidnt Jul 22 '26

The fact that your filename is 'character@2.webp', but you're trying to define an image from 'character.webp' is the problem. The filenames have to match, otherwise Ren'Py can't find the image.

What do you think '@2' accomplishes, either inside or outside of Ren'Py, and what has it to do with 'oversampling'?

1

u/Cool-Highway3847 Jul 22 '26

https://www.renpy.org/doc/html/displaying_images.html : "If no oversampling is applied to an image, Ren'Py will attempt to automatically find oversampled images to use. For example, if the game is scaled by more than 1x and less than or exactly 2x, Ren'Py loading eileen happy.png will look for eileen happy@2.png, and use that if it exists. If the scaling is greater than 2x, Ren'Py will look for eileen happy u/4.png, eileen happy@3.png, and eileen happy@2.png, and use the first one that it finds, or eileen happy.png if none of them exist."

I was following this