im.Scale (and FactorScale) leave slightly translucent images

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
radionerd
Newbie
Posts: 2
Joined: Sun Oct 29, 2017 2:56 pm
Contact:

im.Scale (and FactorScale) leave slightly translucent images

#1 Post by radionerd »

Hello everyone. I have been playing around in RenPy trying to learn how it works. I seem to have run into a problem with the image manipulator functions.

I have set the game's display resolution to the maximum size of the majority of my assets. There are still some assets that are at a lower resolution that I want scaled up to the display resolution.
My code looks like so:

Code: Select all

image bg157c = im.Scale("bg157c.png", 1894, 1024, bilinear=True)
scene bg157c
When I do this, it doesn't make the background fully opaque; I can still see the placeholder background grid behind the image.
When I change the code to

Code: Select all

image bg157c = im.Scale("bg157c.png", 1894, 1024, bilinear=True)
scene black
show bg157c
The placeholder grid disappears and it is displayed properly.
http://screenshotcomparison.com/comparison/122092

Also, the zoom transform seems to work just fine.

Code: Select all

image bg157c:
	"bg157c.png"
	zoom 1.85
I have checked the images in Photoshop to make sure there is no transparency in the PNGs. The problem still persists if I am using BMPs. I'm hoping someone can shed some light on what is going on and how I can fix this.

AXYPB
Regular
Posts: 95
Joined: Thu Sep 04, 2014 3:04 am
Github: AXYPB
Contact:

Re: im.Scale (and FactorScale) leave slightly translucent images

#2 Post by AXYPB »

The checkered grid beneath partially transparent images appears only when the developer mode is enabled, as when you are running the project from the launcher rather than standalone. When it is run as a built distribution or when the developer mode is disabled, it will be drawn over a black background. You can verify what the end user will see by adding define config.developer = False to an init: block.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: im.Scale (and FactorScale) leave slightly translucent images

#3 Post by Imperf3kt »

AXYPB wrote: Mon Oct 30, 2017 12:20 am The checkered grid beneath partially transparent images appears only when the developer mode is enabled, as when you are running the project from the launcher rather than standalone. When it is run as a built distribution or when the developer mode is disabled, it will be drawn over a black background. You can verify what the end user will see by adding define config.developer = False to an init: block.
I believe this is inaccurate. In all of my built games, including Android ports, you can clearly see the checkered background.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

radionerd
Newbie
Posts: 2
Joined: Sun Oct 29, 2017 2:56 pm
Contact:

Re: im.Scale (and FactorScale) leave slightly translucent images

#4 Post by radionerd »

AXYPB wrote: Mon Oct 30, 2017 12:20 am The checkered grid beneath partially transparent images appears only when the developer mode is enabled, as when you are running the project from the launcher rather than standalone. When it is run as a built distribution or when the developer mode is disabled, it will be drawn over a black background. You can verify what the end user will see by adding define config.developer = False to an init: block.
Thank you for this. As soon as I put the line it, it fixed every instance of it.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: im.Scale (and FactorScale) leave slightly translucent images

#5 Post by Imperf3kt »

Just decided to come back to this and mention that I am also now seeing this phenomenon.
I am also seeing white lines on the right and bottom edges (which I did not see -as much-) in Ren'Py 6.99.12.4

I am currently running Ren'Py 7.1.0.0 on Linux on an ARM based device, but I also see this same behaviour on an Intel 64bit Laptop with Windows 10 and Renpy 6.99.12.4

Take a close (or even not-so-close) look at this screenshot to get a clear idea of what seems to be going on.
https://i.imgur.com/iCrb61T.jpg

This is not a game with developer mode enabled.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: im.Scale (and FactorScale) leave slightly translucent images

#6 Post by mitoky »

In my case i had a problem with a snow effect. For that i used a snowflake image and to make diffrent sizes, i used im.FactorScale. You could clearly see that the slighly transparent edges are black/darker.

Post Reply

Who is online

Users browsing this forum: No registered users