Two transparency levels

Discuss any general programming issues here
Post Reply
User avatar
Posts: 131
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland

Two transparency levels

Post by r-tea »

I created three small two-colour png images in Personal Paint.
Theese are white crosses onto black background. Images are of the same size and crosses are different.
I need to display them as brushes. I need the black background to be fully transparent and the white crosses half transparent.
How to obtain it easily?

User avatar
Posts: 4394
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany

Re: Two transparency levels

Post by airsoftsoftwair »

You can manually apply the desired transparency settings with Hollywood but why don't you simply create PNGs with alpha channel that have your desired transparency settings already applied?

User avatar
Posts: 365
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO

Re: Two transparency levels

Post by jPV »

There are many ways to do this in Hollywood, but here's an example of few cases:

Code: Select all

@BRUSH 1, "ram:1.png", {LoadAlpha=True} ; Load a brush that already has a (alpha) transparent color
@BRUSH 2, "ram:2.png", {Transparency=#BLACK} ; Load a brush and set a color in it transparent
@BRUSH 3, "ram:2.png" ; Let's set transparency later

SetBrushTransparency(3, #BLACK) ; Makes the black color transparent for the brush 3

; These will display brushes with transparent black color, but white fully visible

; When doing partial transparency we have to notice couple things....

; Brush 1 has already alpha channel, so you can just reduce it
ReduceAlphaChannel(1, "50%")

; Brush 2 is using a mask for transparency, so we have to change it to alpha channel first
ChangeBrushTransparency(2, #ALPHACHANNEL)
ReduceAlphaChannel(2, "50%")

; The previous ones modified the original brushes, but we could also do the transparency when displaying the brush and keep the original brush intact

BTW. when you save images in PPaint (as PNG for example), the color at the index 0 becomes transparent, and if you load such image in Hollywood with the LoadAlpha=True option, you don't have to set the transparent color manually.

PPaint can't do other kind of alpha transparency, so if you'd want fully processed semi transparent images that don't need processing in the actual Hollywood script, you'll have to use some other programs too... like RNOEffects ;)

Post Reply