How to show image with some alpha channel? [solved]

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
ShadowScaleFTL
Regular
Posts: 34
Joined: Sun Aug 16, 2015 12:11 pm
Contact:

How to show image with some alpha channel? [solved]

#1 Post by ShadowScaleFTL » Sun Oct 23, 2016 11:28 am

So i make an art. And alpha black and white mask, So i need to show art with this mask. How i can do this? I mean show just a part of art
Last edited by ShadowScaleFTL on Sun Oct 23, 2016 2:31 pm, edited 1 time in total.


User avatar
Lemme12
Newbie
Posts: 4
Joined: Sun Oct 23, 2016 11:06 am
Contact:

Re: How to show image with some alpha channel?

#3 Post by Lemme12 » Sun Oct 23, 2016 1:38 pm

What exactly are you trying to show/make transparent? Is it a movie or a picture?

If it's a picture, then you don't need a black and white alpha mask, all you need is to open up the picture in Photoshop or GIMP(which is free), and edit the background/part of the picture to be transparent. Then export the picture as a PNG and it should work just fine in Renpy.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to show image with some alpha channel?

#4 Post by Ocelot » Sun Oct 23, 2016 1:39 pm

Check out AlphaMask displayable: https://www.renpy.org/doc/html/displaya ... splayables

Something like:

Code: Select all

image art = AlphaMask('art.png', 'mask.png')
However, it you do not intend to reuse single image with different masks, it might be better to do as Lemme12 suggests and just make a single image already modified to your tastes.
< < insert Rick Cook quote here > >

ShadowScaleFTL
Regular
Posts: 34
Joined: Sun Aug 16, 2015 12:11 pm
Contact:

Re: How to show image with some alpha channel?

#5 Post by ShadowScaleFTL » Sun Oct 23, 2016 1:45 pm

Lemme12 wrote:What exactly are you trying to show/make transparent? Is it a movie or a picture?

If it's a picture, then you don't need a black and white alpha mask, all you need is to open up the picture in Photoshop or GIMP(which is free), and edit the background/part of the picture to be transparent. Then export the picture as a PNG and it should work just fine in Renpy.
Its a part of animation and will used with a lot of arts, so i cant to edit all of them to use in similar animations. So i need a mask to use it

ShadowScaleFTL
Regular
Posts: 34
Joined: Sun Aug 16, 2015 12:11 pm
Contact:

Re: How to show image with some alpha channel?

#6 Post by ShadowScaleFTL » Sun Oct 23, 2016 2:31 pm

MaxYablockin wrote:You need im.AlphaMask() https://www.renpy.org/doc/html/displaya ... .AlphaMask
Thanks. it helps!

Post Reply

Who is online

Users browsing this forum: Hojoo