Sign in to follow this  
Guest misho

How to remove Resampler Black Borders?

Recommended Posts

Anyone know an easy way :-jumpy to get rid of the horrid black border that the latest resample.exe (MSFS2002 Terrain SDK)gives when creating photoscenery?The picture quality is great but I wonder why they didn't just chop off the partially filled LOD areas as in the FS2000 resample.exe. Perhaps they use the black border to merge with the default scenery somehow.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi colinlitster.The black area is created when your data ( original bitmap ) is not large enough to cover the area you are resampling for. The black shows the incomplete area. The only easy way to get rid of it is to resample the data for a smaller area.There is a 'complicated' way to actually use that black area, but you'd have to learn BGLC coding for VTP Method1 polygons, as described in the FS2002 Terrain SDK.Another 'complicated' way is to rework the 'slices' with a paint program. Just remember to run the reworked slices through imagetool to put them back in the proper format when you're done. This method isn't really so odd, as that is what we do when we add alphachannel water. But in this case, you are working with the main layer, not the alphachannel. You could try to use the black area as a mask of some sort, and blend into the slice a default landclass texture ( so that replaces the black ). That would give you a photoreal, blended into the default tiles... just like the VTP Method1 polys would.Dick

Share this post


Link to post
Share on other sites

Stop using the tools from the fs2002 sdk, revert instead back to the tools of fs2000....they work nearly the same. The huge advantage to fs2000 resample.exe is that it IGNORES source photo area beyond the lod13 boundary, rather than displaying black. the only downside is that it does a poor job of maintaining resolution during the resample, but this is easily overcome, just do your resizing of your resolution first before running resample.exe.Take your source photo and resize the pixel count so that you have a resolution of 4.8m/pixel. Then submit to resample.exe from fs2000. The other big difference is that fs2000 terrain technique requires one additional step, that is, once you run the fs2000 resample.exe, you get textures and a .tmf file. Now you run tmf2bgl.exe on the tmf file to get your bgl file.Good luck!Bob Bernstein

Share this post


Link to post
Share on other sites

The correct way is to bound the resample area within the image area. You do this by setting UseSourceDimensions = 0. Then set the North and South Lat values at a multiple of 0.010986328125 deg and the East and West Lon values at a multiple of 0.0146484375 deg. These are the degrees of lat and lon in a LOD 13 cell.As an example I created a bmp called Area0505.bmp that went from N40

Share this post


Link to post
Share on other sites

Thanks guys.I will have a go at the formula stuff later today to see if I can crack it. I'll probably create a spreadsheet to make sure I do the right calculations. Colin

Share this post


Link to post
Share on other sites

One quick and dirty method is to use both resamplers -- using the same inf file, create the tiles with the new one and the BGL with the old one. It worked for me, but I normally don't have resample resize for me.The new resample goes to show you can't have everything :)By the way, when you get a working ss solution you should post it here!

Share this post


Link to post
Share on other sites

Hi Frank.Thanks for the great post on how you derive the INF info. I used your method on the notorious Niagara scenery, and it worked well, and placed 12 slices right where M$ has them in their example.Dick

Share this post


Link to post
Share on other sites

Old resampler pixel-resizes.New resampler averages pixels.result: Much better resizing of the imagery, no need to do it in the photo editor.

Share this post


Link to post
Share on other sites

Hello Frank,Great method and many thanks for posting. Perhaps you would consider putting together a spreadsheet and instructions and releasing it for general use. It would be a great help to us all.Best regards.Luis

Share this post


Link to post
Share on other sites

Attached is a little spreadsheet that will do theses calculations. To use it verify the LOD value you want to use, and enter the Lat and Long of your photo boundaries.I don't know if this will work or not because this forum only allows uploading jpeg gif html or txt files to this forum. Try downloading it and renaming it with an .xls extensionGood luck,Frank Smith :-haloPS: I just tested the download. If you right click on the link and tell it to "Save Target As" and give it an .xls extension it works.

Share this post


Link to post
Share on other sites

Hi Frank.Have now tried the technique with both your spreadsheet and the one I created last night. Fortunately they both agree on the values. However, although the scenery created has no black borders it is chopped off much more than where the black borders were.The image is 8738 x 11652 and the co-ordinates are as follows from your spreadsheet.LOD = 13 Level of Detailn = 8192 Number of segments in 90

Share this post


Link to post
Share on other sites

I think by definition you will lose at least part of your image -- the black border is the part of a LOD square where your image doesn't extend to -- you can't just remove the black border, you effectively remove a row of cells to the LOD border. The calculation you've done just determines how much of your image needs to be cut off to match the border.

Share this post


Link to post
Share on other sites

All this complication, computation, and concern just to avoid resizing your image in photopaint, photoshop, gimp, paintshop pro, etc? The process still requires the designer to adjust, colorize, perhaps equalize contrast areas, create multiple image sets based on season....so you can't avoid using these programs....but resize? now that's just going too far! LOLSeems like just about the easiest operation I can imagine. I'd never choose a new resample.exe that forces me to deal with black borders just to avoid something as simple as this. Each to their own.Bob Bernstein

Share this post


Link to post
Share on other sites

Hi Bob.I agree... it just seems like too much!Something I've found out is that neither the new or old Resample does a decent job of resizing. The slices usually look terrible. So I go back to the original bitmap, and adjust and colorize as you say, then slice it myself! Then I rename my slices to replace Resample's slices. The images are a lot clearer. Total control, as you know how the slice will ultimately look. Even in the Niagara example, Resample insists on resampling, even though it's 4.8 meters to start with, and only needs to slice! The result? Blurry, out of focus...So Resample is good to make the BGL, and gives us the correct names of the bitmaps... and little else.Maybe we need a program that will take a bitmap already resized and adjusted ( in a multiple of 256 ), and simply slice and properly rename the slices. Then we can discard the slices from Resample.Guess which image came from Resample?Dick

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