Need help with character pictures

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.
Message
Author
User avatar
Din Redfire
Newbie
Posts: 22
Joined: Mon Sep 09, 2013 4:48 pm
Projects: Arcadia's Tales
Contact:

Need help with character pictures

#1 Post by Din Redfire »

I did my first character's sprite for the visual novel. Problem is, I can't make the background transparent for my character. I'm using Sai and I tried to add the layer ''luminosity'' under all my other layers and use the ''luminosity to transparency'' but when I open my game, my character still have the white background behind her and it looks kind of ugly ^^' Does anyone have any advices, please?

chibiansem02
Newbie
Posts: 21
Joined: Sun Sep 01, 2013 1:51 am
Contact:

Re: Need help with character pictures

#2 Post by chibiansem02 »

Do you have the full (paid for) version of SAI?
I worked out the issue of transparent BGs not 24 hours ago thanks to the help of someone here, haha!

I would recommend using a program like Gimp (it's a free download) to give your sprite a transparent BG.
Sai is great for drawing (it's what I use most of the time) but doesn't work well with transparencies.
Hope this helps!

:)

User avatar
Green Glasses Girl
Veteran
Posts: 367
Joined: Thu Jul 11, 2013 7:16 pm
Projects: Cavaliers & Carnivals
Tumblr: green-glasses
Contact:

Re: Need help with character pictures

#3 Post by Green Glasses Girl »

Uh, what are you saving your files as? .jpeg or .png? You'll want to delete any solid background layer you have and save as .png.
Image

Honest Critique
Avatar art by akemicchi.

User avatar
Din Redfire
Newbie
Posts: 22
Joined: Mon Sep 09, 2013 4:48 pm
Projects: Arcadia's Tales
Contact:

Re: Need help with character pictures

#4 Post by Din Redfire »

I don't have the full version unfortunately and I did save in png. I downloaded Gimp but I'm wondering how I should do it. Should I save my drawing in jpeg and open it on gimp to save it as png later?

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Need help with character pictures

#5 Post by Elmiwisa »

Did you save the alpha channel too when you choose to save as png?

User avatar
Din Redfire
Newbie
Posts: 22
Joined: Mon Sep 09, 2013 4:48 pm
Projects: Arcadia's Tales
Contact:

Re: Need help with character pictures

#6 Post by Din Redfire »

Is that an option for Sai? Didn't see anything like that.

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Need help with character pictures

#7 Post by Elmiwisa »

When you try to save in SAI, it ask for RGB or ARGB right? The A means that it will save the alpha channel.

quilty
Newbie
Posts: 14
Joined: Sat Sep 07, 2013 4:32 pm
Projects: [currently unnamed]
Location: Quilty, Clare
Contact:

Re: Need help with character pictures

#8 Post by quilty »

You can save your SAI file as a psd file and open it up in GIMP, that should give it a transparent background and then you can save it as a png with GIMP.

User avatar
Din Redfire
Newbie
Posts: 22
Joined: Mon Sep 09, 2013 4:48 pm
Projects: Arcadia's Tales
Contact:

Re: Need help with character pictures

#9 Post by Din Redfire »

Elmiwisa wrote:When you try to save in SAI, it ask for RGB or ARGB right? The A means that it will save the alpha channel.
For me it didn't o.o' Well I'll give a try at saving as psd and I'll see if it works.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Need help with character pictures

#10 Post by trooper6 »

What is te alpha channel used for?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Tempus
Miko-Class Veteran
Posts: 519
Joined: Sat Feb 16, 2013 3:37 am
Completed: Ladykiller in a Bind
Projects: StoryDevs
Tumblr: jakebowkett
Deviantart: jakebowkett
Github: jakebowkett
Location: Australia
Contact:

Re: Need help with character pictures

#11 Post by Tempus »

trooper6 wrote:What is te alpha channel used for?
It defines which pixels are transparent or opaque (or somewhere in between) in an image.

Incidentally, some game engines use the alpha channel for other things. For example, Fallout 3 uses the alpha channels of normal maps to control the visibility of specular reflections.
StoryDevs — easy-to-search profiles for VN devs (under construction!)

User avatar
Din Redfire
Newbie
Posts: 22
Joined: Mon Sep 09, 2013 4:48 pm
Projects: Arcadia's Tales
Contact:

Re: Need help with character pictures

#12 Post by Din Redfire »

Okay, turns out I can't turn my file into a psd because some spots of my coloring shows up when they're not supposed to in my final drawing (creating some stain-like spots all over my character, kind of hard to explain without a picture to show it) But I'm managing to erase the background around the character. It will just take more time... I just hope I'll find some new solutions for my next drawing or it's going to take lot of time for each sprites ^^'

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Need help with character pictures

#13 Post by Elmiwisa »

If it become a last resort, Ren'Py have im.AlphaMask to impose a new alpha channel onto what your image already have. Which means that instead of a single image with alpha channel, you can make 2 JPEG, one is the image, and the other is to provide the alpha channel.

User avatar
Din Redfire
Newbie
Posts: 22
Joined: Mon Sep 09, 2013 4:48 pm
Projects: Arcadia's Tales
Contact:

Re: Need help with character pictures

#14 Post by Din Redfire »

Do I need to download it or go into the options for that? Started using Ren'Py yesterday so I'm not familiar with it at all for now ^^'

Well even after erasing manually, I still have the same result -_- I still have the gimp format but now I really don't know what's wrong.

Image

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Need help with character pictures

#15 Post by Elmiwisa »

Din Redfire wrote:Do I need to download it or go into the options for that? Started using Ren'Py yesterday so I'm not familiar with it at all for now ^^'
No it is a function already in Ren'Py itself. I would suggest figuring out a way to do it using image editor rather than this, but oh well maybe you will get to learn something about Ren'Py with this too? :?

Ok, here is how you do it. Keep this character's image open in a window, and start a new image. Make sure this new image have the exact same dimension (in term of pixel) as the character's image. This new image will serve as the alpha mask for the character image. Our goal is to make the region in this new image corresponding to the character in the character's image to be red, and the remaining part to be black.
In this new image, fill it completely in red (that is the numerical value of the colour is #ff0000). Then go back to the character image, use fuzzy selection tool to select the white background area. Then copy and paste that region to the new image and make sure it fit completely inside. Now in the new image you should have something that looks like a red silhouette of the character with white background. We want the background to be back. Flatten it all into a single layer. Then Fill the white region to make it black. Save it in the project folder.
Now we can use alpha-mask:
Let's say you name this new image to be it "blue_eyes_guy_mask.jpg" and your character's image to be "blue_eyes_guy.jpg". Let's say you want the image in your game to be named "guy smile". Add in this code to the top of your file:

Code: Select all

image guy smile=im.AlphaMask("blue_eyes_guy.jpg","blue_eyes_guy_mask.jpg")
Now if you do

Code: Select all

show guy smile
the white part background would be made transparent.

As I said, it is very complicated. And you have to do it for each image. Last resort only.

Post Reply

Who is online

Users browsing this forum: No registered users