• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Extract watermask from .bgl

Messages
137
Country
portugal
Hi,
I have made satellite image with a very complex watermask months ago.
Now I found updated satellite image, so I want to use the same watermask on this image.
Is there any way to extract a watermask.bmp from a .bgl?
 
Pretty sure to be able to do so would defeat the purpose of having the ability to apply one.
 
There is an alpha version of a decompiler for photo bgl files.

But if you made it yourself, why just not go back to your sources? Always good to keep your sources :)
 
Arno, trust me, from now on I will start to make a backup of the backup.
Is that alpha version out there or private?
 
It was posted here in the forum, search for bgldec.
 
http://www.fsdeveloper.com/forum/threads/bgldec-a-resample-bgl-decompressor.433789/

A few notes if you are using it to get your source back - it's better than nothing, but it's not going to be nearly as high quality as the source.

1. It will most likely be slightly stretched / skewed based on the lat-lon of where it is located. This is part of the resampling process.
2. It will most likely by surrounded by some black "padding" pixels, so the image aligns to the FS QMID grid. This means it will not place at the exact same coordinates as your original image in-sim when run back through resample. I am working on writing new .inf files for this, not done yet.
3. The images are downsampled to 16-bit color (5.5.5.1) + an 8 bit blend alpha mask.
4. Water mask is not exported as a separate mask, except as a blue (0x000080) pixel in BMP. If you export as BIN you could sample it yourself from bit 15 in the 16-bit colors. Are you specifically talking about the water mask though? Most people are more interested in the blend mask, the water mask is just a single bit that enables some minor visual effects on top of the texture.

The good news is, if you run it back through resample, with a high-90s or 100 Compression Quality, WYSIWYG in the sim.

Since it sounds like you want to reuse the resampled water mask on a non-resampled source image, I'm afraid there might be a significant amount of post-processing that you will need to perform to get it to line up with your source. It may be easier to start over, unfortunately.
 
Thank you. I believe that's exactly what I was looking for.

I think I can work it out even with not very high res.

Now, I don't know if I understood correctly how it works. Copy the .exe to the sim root, and drag the .bgl into the .exe. It made some .bin files. Was that the way to go? Because if I click on the .exe only it doesn't open anything...
 
I really need to redo the help for v1.0.

It's a command line program, so you will need to give it some parameters. It's no longer necessary to have it in the sim folder, as long as you have the bgl in the folder alongside bgldec.exe it will work.

So open a command prompt, you can do this by hitting Windows key + R, it will open the "Run" dialog, type cmd and press enter. You will then need to type
Code:
cd "BGLDECFolder"
for the folder you have bgldec in, like
Code:
cd "C:\users\Sean\Downloads\bgldec"
for example. Press enter and the command prompt will be in the right folder.

From there, type
Code:
bgldec yourfilename.bgl BMP-STITCH extracted
. This will place the output BMPs from yourfilename.bgl into the subfolder "extracted". The -STITCH tells it to make a single image instead of outputting all of the tiles separately. You can also use BIN-STITCH for the raw data instead of in a bitmap.
 
I read the thread and the .txt file and apparently I didn't understood how it worked. But now I did! Thank you for the explanation.
That was exactly what I was looking for. It's tricky to make it precisely on the place you want since the image is stretched, but after some work on photoshop I was able to do it. Is not 100% perfect but it does the work.

Thank you. Very nice job on the program, keep it going!
 
Back
Top