Jump to content

I need to make transparent part of a bmp


Falaise

Recommended Posts

I need to make transparent part of a bmp
I understood that by recording in 32 bits ds the bmp became transparent
but I want only a part to become transparent
I use photoshop7
  I think it has a link with the alpha channel but I do not understand how to do it

it is to erase the armature of the earphones

190810025854359638.jpg

Edited by Falaise
Link to comment
Share on other sites

1 hour ago, Falaise said:

I understood that by recording in 32 bits ds the bmp became transparent

It will only become invisible with an alpha channel. The bit depth is an expression of available tonality, and is a different concern altogether. Alpha channels control what is concealed or revealed based upon RGB values.

To add the alpha channel in Photoshop, create a new layer mask attached to the initial graphic, and then fill the layer mask with 0,0,0 RGB- completely black. This is the alpha channel setting for "not visible- 100%". Save as a .bmp with the layer intact (with included alpha channel). The 0,0,0 RGB is a signal to the game engine that the graphic is concealed or "invisible". It can also be done in variations of the RGB values to create opacity effects, etc.- but 0,0,0 for completely dissapearing something.

Link to comment
Share on other sites

38 minutes ago, Falaise said:

I downloaded pixelformer
But as with photoshop
in 24 bits

Same thing as @Kevin2k said.  To make an Image background transparent I use Paint.  Then use Pixelformer to import the PNG with transparency and convert it to 32 bpp RGBA (with alpha channel) and save to BMP format.  Below are my notes for pixel former.

Open Pixelformer

Import desired image into Pixelformer

   In upper left corner of Pixelformer click File

   In the dropdown click Import

Navigate to desired file, select and click Open  

The selected file will now be displayed in Pixelformer  

In the top right of Pixelformer, right click on the top blue box where the pixel size is displayed. Example:

   2048 x 256RGBA.

In the dropdown click on Properties.

In the window click the top choice: RGB color with alpha channel (32bpp).

Click Okay.

In upper left corner of Pixelformer click File

In the dropdown click Export 

In the window go to Save as type: and select Windows bitmap (bmp)

Then go up one field to File Name.

After the file name type _32bit  (don’t forget the underscore)

Click Save

The BMP options window will appear.

Select the third format choice: A8:R8:G8:B8 (32bpp)

Select Premultiplied alpha

Click OK 

 X out to close.  (The image will be in the folder you saved it to)

Link to comment
Share on other sites

You seem to be doing it right. Is it maybe that not all 3D models/objects can work with an Alpha channel?....

Edit: I get the same thing. .BMP with lots of red color is visible in game, but as soon as I add an Alpha channel the headset is not shown at all.

Edited by Kevin2k
Link to comment
Share on other sites

  • 5 weeks later...

latecomer in here. I work with my trusted old PS7 on CM files exclusively and had no major problems. The majority of CM bitmaps work with Alpha channels pretty well, even if they didn´t have any originally. I´d experimented some with the sandbags.bmp to make these invisible on the trenches and foxhole objects, which works (whole alpha layer opaque). Since I wanted something different for the sandbag wall object (sharing the same bitmap) I got to rename some stuff, both the bitmap and associated link buried in the '.mdr file. The sandbag wall objects (sandbags-right1.mdr & sandbags-left1.mdr) now link internally to a new file named sandbaks.bmp and this works as well.

With regard to the helmet (I worked with some as well, though german), there could possibly exist some cross linkage within the  *.mdr files pointing to different BMP files. So one got to figure these out first (I use a HEX editor for searching and "hacking" mdr files). In case of the tankers helmet and earphones I´d likely investigate all bitmap linkages within the *.mdr files to assure one works with correct files. Many bitmaps are reused (or shared) for different objects and it can become a bit complicated at times.

I experienced that when I wanted german officers wearing a standard helmet instead of the officers cap in example. Got it working at last but methods applied were a bit tricky.

Link to comment
Share on other sites

52 minutes ago, benpark said:

Kevin- Red is just to help you see it. Like an old rubylith mask done by hand in days of yore. It’s all black, white and greyscale with masks. White reveals, black conceals.

thanks for reminding. Some files require plain black-white alpha, while others (foliage i.e) work with grey scale only I think. Using wrong alpha channel types can lead to ugly results or a texture showing plain black (or not at all). Not to forget as well is "normal map" files, but in case they´re missing the game engine creates some generic bump mapping on the fly.

Link to comment
Share on other sites

There are some decent bump map making programs out there if you don't want to mess with the Nvidia tools, or do PSD funnyness- CrazyBump being one. It's a little on the overly-sharp side, but can be controlled by tweaking it in the generous settings. It can be made from a standard BMP file.

Link to comment
Share on other sites

56 minutes ago, RockinHarry said:

thanks for reminding. Some files require plain black-white alpha, while others (foliage i.e) work with grey scale only I think. Using wrong alpha channel types can lead to ugly results or a texture showing plain black (or not at all). Not to forget as well is "normal map" files, but in case they´re missing the game engine creates some generic bump mapping on the fly.

A greyscale alpha layer is just a representation of percentage of visibility.

In numeric language (Photoshop is a mathematically based engine at heart) 0/0/0 RGB is "black"- no image visible. 255/255/255 RGB is "white"- image completely visible. So any variant of that between those values will be partly visible in keeping with the distance from the two book-end values.

There is no generic bump mapping without the Normal Map. You will see the game engine shaders doing their own magic, but you won't get the underlying details that the Normal Map provides.

Edited by benpark
Link to comment
Share on other sites

5 hours ago, benpark said:

Kevin- Red is just to help you see it. Like an old rubylith mask done by hand in days of yore. It’s all black, white and greyscale with masks. White reveals, black conceals.

What I meant was, that I made a red colored headset texture, for checking out whether or not the texture was being utilized for the headset I was looking at in the game. Just to make sure.

6 hours ago, RockinHarry said:

latecomer in here. I work with my trusted old PS7 on CM files exclusively and had no major problems. 

So Photoshop 7 introduced support for alpha channel .bmp files. Good to know that. 

Link to comment
Share on other sites

MOST knockout channels in the game need to be 100% black & white with no anti-aliasing or feathering along the edges. One grey pixel is enough to cause the whole texture to disappear in-game. There are some exceptions to that rule like tree foliage and grass which can handle 'soft' edged between the black and white.

Back-in-the-day the game used to handle windshield transparency with a % of grey knockout channel but it was causing more problem than it was worth and that was abandoned in favor of assigning the transparency value on the model itself.

Link to comment
Share on other sites

7 hours ago, benpark said:

There is no generic bump mapping without the Normal Map. You will see the game engine shaders doing their own magic, but you won't get the underlying details that the Normal Map provides.

That´s what I meant actually. Shader does the work (think as programmed or at least configurable in bumpmapping.frag) when there´s no dedicated normal map present.

Link to comment
Share on other sites

2 hours ago, MikeyD said:

MOST knockout channels in the game need to be 100% black & white with no anti-aliasing or feathering along the edges. One grey pixel is enough to cause the whole texture to disappear in-game. There are some exceptions to that rule like tree foliage and grass which can handle 'soft' edged between the black and white.

Back-in-the-day the game used to handle windshield transparency with a % of grey knockout channel but it was causing more problem than it was worth and that was abandoned in favor of assigning the transparency value on the model itself.

Thanks. That says it most precisely. Had some these hassles (turning black or invisible) when I "converted" bocage and associated foliage to flavor objects. Took me a while to figure out that the same foliage BMP works not the same for flavor objects.

Link to comment
Share on other sites

A word of caution about online normal/bump map tutorials.
Mostly, their instructions are good if you're doing stone textures or dragon scales. But they're inadequate if you're doing raised rivets, bolts and ridges. Then you gotta forget about the original art and create your own art to raise and lower just what you want. See attached, one of the tires in CMBS. The stuff I wanted raised is lighter, the stuff I wanted lowered is darker, and the superfluous detail on the original art I don't worry about.

Normal map sample.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...