Jump to content
Sign in to follow this  
Guest iholrf

Alpha Channel Oddness

Recommended Posts

Guest iholrf

Hello all,I am attempting to recreate the alpha shadow/light properties as used on the magnetic compass XML gauge from the DC3. The problem I am facing is how do I create or modify the bitmap that is an alpha channel?I use an old version of paintshop pro (5.1) and any modification I make to the shadow_alpha bmp, for example, results in a loss of transparency even if I make no changes and simply "save a copy as". It seems to have no trouble seeing the bmp, all the information is present except the alpha channel apparently.I have tried creating it as 24 bit and 8 bit greyscale, 24 bit true color (at least black is transparent in 24 bit) and even just simply manipulating a copy of the dc3 shadow alpha bmp. No luck on any front.So is it PSP or me? Any idea would save the loss of the few remaining strands of hair I have left on my head.TIAShad

Share this post


Link to post
Share on other sites

I went through this not too long ago, and somebody pointed out that the alpha channel must have the exact same pixels as the color channel. If it doesn't, all sorts of odd things start happening.So start by duplicating the image for the alpha channel, making it grey scale and then inverting it. Then use selections to modify the grey scale value on the areas which should be shadowed. But remember, each pixel must be in the same location as the color channel.Hope that helps...--Jon

Share this post


Link to post
Share on other sites

Or... Save your work in PSP as a PSD file (PhotoShop Document). Imagetool will read those together with the alpha channels, making your life a lot easier!Misho


P3D SpacePort Team

Share this post


Link to post
Share on other sites
Guest iholrf

I am not at all sure what you mean about having the exact same pixels as the color channel. I think I need a better understanding about bmp creation and channels. Know of any decent docs on the subject?CheersShad

Share this post


Link to post
Share on other sites
Guest iholrf

>Or... Save your work in PSP as a PSD file (PhotoShop>Document). Imagetool will read those together with the alpha>channels, making your life a lot easier!>>MishoYa know... there are times when my own stupidity is blinding. I tried saving it as TIF and TGA. I thought about trying to save it as photoshop file, but figured it would be unlikely that PSP had a means to save a photoshop doc. Did I actually check to see if it could? No. Can it... yes.I even went so far as to go to Corel's site and download the trial version of PSP 9.0 (typical Corel... their download site is broken).I am my own worst enemy.The results so far (no alpha yet)Flathttp://forums.avsim.net/user_files/122138.jpgReflectivehttp://forums.avsim.net/user_files/122139.jpg

Share this post


Link to post
Share on other sites
Guest Ionizeyou

After having finally figured the "alpha highlight" puzzle out myself... and the SDK is absolutely no help in this... I'm fairly certain that what he means is to have an exact image of the "reflection" as the "alpha" channel. The difference being that the alpha channel is inverted.To make life easy, create your "reflection" on a seperate layer above an RGB black (0,0,0) background. This way you can adjust the transparency of the effect without having committed the image to the background. Once you have the desired reflection, merge the two layers and save as a Photoshop, .psd image. In photoshop, open your image file and on the toolbar, click "select, all". Copy this selection of the main raster image. Next, click the "channels" tab and then the "create new channel" button within the layers pallet. Highlight your new alpha channel on the layers pallet, and then select "Edit", "paste into", and your main image will now be copied to the alpha channel. Save your image and close it out.Next, with Imagetool, open your image and select, "image", "alpha channel" and then "invert". Your alpha channel will now be an exact, grayscale negative image of your main color reflection image. Now convert your image to 8 bit by selecting "image", "format", and then "8 bit". Save the image as a panel bitmap of your choosing, remembering to include the Alpha="Yes" tag in the image properties line. You can also select Luminous or Bright to make it stand out more if you like.By using this technique, it's possible to create your reflection in color, but beware that some colors may interfere with your gauge coloring... in this case, a gray-scale image may be your best bet. Hope this helps to clarify what usually ends up being a bad nightmare!

Share this post


Link to post
Share on other sites
Guest iholrf

Thanks Kevin.Sounds like a good technique... the only problem is I am using a very old copy of PSP 5.1, not Photoshop. I am not sure it has all the necessary features as you described. I have no explicit channel menu item, but a selection menu with select all and then send to alpha. I will test it out to see if the app works for this need or will need to scrape up the money for a newer paint program (which i am beginning to feel may actually be justifiable).Thanks, I now understand what the other fellow meant about exact match for alpha. As for the color interfering with the guage, the reflection is the only color on any of the faces.. they are all solid white :) so its all good. If this works, ohohohoho will I be a happy camper.Well done figuring that out.CheersShad

Share this post


Link to post
Share on other sites
Guest Ionizeyou

Yeah Shad... I seem to have a much easier time creating alpha channels with photoshop. I've not yet been able to save an alpha channel with PSP, and then be able to open the image in imagetool. I always get a corrupt image message. Maybe someone else can help with the Paint Shop alpha issue.As for the color, what I'm getting is some yellow shading on portions of my white items if the "reflection" color is tinted blue. So... you might run into something similar.

Share this post


Link to post
Share on other sites

Shad,I'm sorry, I seem to have missed the followup on this one.Kevin is correct in that I meant that the alpha channel must be a perfect match, pixel per pixel, of the RGB/Greyscale channel(s). I'm sure you've already figured that out:)--Jon

Share this post


Link to post
Share on other sites
Guest iholrf

Not to worry, I have lost track of more than one thread myself. :)CheersShad

Share this post


Link to post
Share on other sites

Thought I'd bump this thread up from nearly a year ago to thank everyone who responded. I've tried to figure out the secret to alpha highlighting on at least 3 occasions over the past couple years. Spent a few days pulling my hair out each time until I finally gave up. It seems the general consensus is that the Panel SDK is worthless in explaining how this is done, and with that, I whole-heartedly agree ;) .With the help of this thread and another similar one, I successfully added an alpha highlight to a couple of my homemade gauges last night, and man am I stoked!I'm still working on the artistic aspect of creating a believable glass gauge face reflection, but believe me, after seeing nothing but a black rectangle show up in the sim covering up my gauge, time and time again, this looks beautiful :) .Thanks folks! Thanks Avsim!Jimhttp://www.cat-tamer.com/attach/gauge_alpha_highlight.jpg

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Looks really really nice. What is reflecting off of it?Patrick

Share this post


Link to post
Share on other sites
Guest iholrf

Beautiful work Jim. Beautiful.I am very impressed.CheersShad

Share this post


Link to post
Share on other sites

Thanks very much, guys :) ."What is reflecting off of it?"What I did is use the Flight1 view utility to move around in the VC until I was looking aft into the (default 172) cabin from the approx location of the gauge on the instrument panel. Took a screenshot, cropped it square, and resized it to about the size of the glass on the instrument .bmp I'd made earlier.Then I selected a 1:1 circle, copied it, and pasted it as a layer onto the black highlight .psd, moving it to the proper location on the gauge face. I then brought the opacity down to about 30%, removed color (desaturate), and made the actual highlight .bmp as outlined in the posts above.It was just a quickie, I'll probably do a lot of experimenting before I call it finished :) .Thanks,Jim

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...