• 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.

Resample Error

Messages
27
Country
us-northcarolina
I'm getting a error from resample when I try to compile an edited version of the background image. I'm following tutorials, and I can get the photoreal put into FSX like a charm with the whole Add Map -> From Background. Now, I'm getting the issue when, after locating the large .bmp in tools/work, I pull it up in GIMP, and start editing out the images of aircraft on the ramps, cars on the roads, and things of those nature. I overwrite the original .bmp, and it shows up in SBuilderX like it should, all edited and whatnot, but when I try to compile, I get an error from resample. My screenshot is bad, since the resample box only appears for a tiny fraction of a second, I was trying to screencap it for about 10 minutes before I got it. Says the BMP header is corrupt. Don't know where I went wrong.

resameple.png
 
You might need to insure GIMP is qaving a 24-bit bitmap. Just a guess.

Dick
 
I'm going to have a look at that to make sure, but I made a point not to mess with any of the save settings, and simply overwrite the old one. Logic being that it would inherit the old copies settings. 24 bit you say? I will double check right meow.
 
Yep, 24 bit is being selected. 24 bit (R8 B8 G8) to be specific. Any other weird things or details I could be missing?
 
Did you truly overwrite your existing .bmp or did you save it as "Photo01.bmp"? If you overwrote the original it should have a filename like L11X1072X1078Y1933Y1937.BMP, your .inf is looking for "Photo01.bmp"

BTW, try the print screen key when you want to capture what's on screen, then paste it into Gimp or whatever, resize, and save it as .jpg rather than taking a photo of it with your phone :) .
 
You've got me questioning myself now. It certainly does say source file is photo01. I'll have to go back and double check myself now. And that was a screenshot (to paint..) that photobucket isn't letting you zoom in to the original image in the first shot, so I cropped it myself for the second. Quality is only because the resample dialog box on appears in the blink of the eye, then disappears. It was a really weird reaction game trying to get it captured.
 
So, I tried to overwrite it again, this time being sure to truly overwrite. The file name and 24 bit remained the same. Now, when I try to insert it, I get a wrong file format error, and it won't accept it. Google'ing that guy, I find post saying SBuilderX doesn't accept large files. This is a 16000ish-16000ish 1GB high resolution photo. Okay, so I scale it back a little, and try the same thing with a smaller photo. This time, it accepts it, still the same original name and 24 bit, but then the resample error all over again when I try to compile. Bummer.

But that got me thinking, if SBuilderX doesn't want a large file to be added from disk, and I really want an edited version, not straight from the satellite, maybe SBuilderX isn't the option for me. I read tutorials on tiling your ground textures by hand on a plane in GMAX. Perhaps this would work better? 16x16 grid of 1024x1024 tiles would take a while to cut up and then re-assemble, but I'm looking for a good end-product and will go for it if it will work.
 
Ah, I McFigured it out. Hopefully someone else who may have had my problem can learn from this. In GIMP, I've been using File->Export to overwrite the original. Instead, and I never really noticed this, but there is an overwrite option right above Export. Using this, and my previous techniques, it still didn't work. Figured out that deleting the map from SBuilderX, editing it, then trying to load it back up didn't float with SBuilderX. So instead, I left the map as it was in SBuilderX, edited the map in GIMP, overwrote with the said method, then re-opened the SBuilderX file, and the map simply updated itself. Works like a charm. As soon as I get the photo-real up to snuff and am ready to go onto the next thing, you'll be hearing from me again....I can forsee myself running into trouble putting in custom, clear airport elements. The grass looks just fine for what I'm going for, but the runways and taxiways need some considerable sharpening. I found a tut on using GMAX for that, but someone to hold my hand is going to be needed. Staaaandby...
 
Hmmm, this saga is not yet over. I apparently only partially McFigured it out. Yes, the overwrite option works well, but once the map is saved as an .xcf file, so that you can call it quits on the editing for a while and take it back up later, you lose the overwrite option and only left with export, which...once again will load up fine in SBuilderX, but fail to compile. So, where I'm at now, I have one shot to edit everything, no saving or nuthin'
 
As I've mentioned I don't know jack about Gimp but isn't .xcf like Gimp's native format for layered images? So from that you could export a 24 bit .bmp named Photo01.bmp leaving the .xcf intact for further editing? That's what I do in PhotoShop all the time (except .psd vs .xcf, and I usually export .tifs rather than .bmps).

I assumed you used SBuilder to download the imagery and then did add map > from background which would have given you the file named like L11X1072X1078Y1933Y1937.BMP, is that not the case? Apparently this a chunk of imagery you got somewhere else and then imported it into SBuilder?

I know 16000 x 16000px and 1 Gb is no big deal for resample.exe so it must just be SBX that chokes on the size. You shouldn't need to slice up your imagery I don't think, I'm sure resample.exe wouldn't have any problems with it all in one chunk, it can handle up to 2 Gb in a .tif anyway. Besides if you slice it up then you won't know the corner coordinates of each chunk anymore unless you use a GIS tool of some sort to slice it.

Gotcha on the print screen, I thought the distorted window indicated a phone photo but it must have been caught just as it was disappearing off the screen.

Jim
 
Yep, the .xcf is the layered file. The problem comes up when I use the export function to create the 24 bit .bmp. It just doesn't work in FSBuilderX. I'm thinking some evil GIMP sorcery is to blame. Googling some keywords on the matter, I'm not alone with saving and exporting troubles. Starting at version 2.8, they abandoned the use of save for creating files other than .xcf, that function is now exclusively reserved for export. People all around are having issues from what I've read. I'm thinking about downgrading GIMP to an earlier version...I'm just not to the point of purchasing Photoshop yet. Especially with the new T7 enroute. Maybe someday, but for now I need a workaround. Getting outta work here in a few, will try then.
 
GIMP 2.6 appears to work as I hoped. I dunno about that 2.8 non-sense, not sure where they thought they were going. Besides, I'm more used to 2.6, I like it more and know it better, no loss. The only loss I see is spending the whole long weekend troubleshooting, and just figuring it out at the last moment. Whatev's, moving on.
 
I noticed the maps that SBX generates itself from add map > from background are actually 32 bit with an all-white alpha channel, maybe try exporting your .bmp as 32 bit and see if SBX will accept that.

It's beside the point, but you don't have to purchase PhotoShop CS2, the login page is new but previously there was a download link and a key code that would make the program work. I presume if you made an adobe account and logged in you would see that page from the link I posted in the other thread, here it is again to save you some steps:

http://www.adobe.com/downloads/cs2_downloads/index.html

That said it sounds like you're pretty into Gimp and lots of folks have great success with it for all aspects of FS development, I'd probably stick with what I had if it were me because I hate new stuff :) .

CS2 is old (like 2005), I speculate adobe made it available because the CG world was getting a little too familiar with Gimp. Once you learn software you tend to stick with it and I'm guessing Gimp was putting a dent in their bottom line. Solution: leak an old PhotoShop version out there so people can learn on it as an alternative to gimp and maybe a few graphics artists will continue using adobe stuff later on in their professional careers? Lol, honestly I dunno sh*t and I'll be the first to admit it...

Waiting for the T7 aye? For me it's been the A2A Skyhawk - which became available just a few hours ago :) .

Jim
 
Yep, all's good here. Figured out the white alpha thing when I tried cropping the map, leaving transparencies around where there's supposed to be default terrain. Turns out SBX took the transparency as to be the shimmering water effect. Round 1 left me with a flooded airport. Ha, live and learn. Thanks for the ye old assistance.
 
Hello:

AFAIK, in SBuilderX the 'visual' part of a aerial imagery BMP must be 24-bit not 32-bit; use of a 32-bit image will result in a "water" attribute being superimposed onto one's aerial imagery.

With the 'visual' part of a aerial imagery BMP set at 24-bit, one must follow other procedures (documented elsewhere rather nicely by Jim Robinson, BTW :cool: ), to make use of an Alpha channel to define water.


If in addition, one wishes to "Blend" the water part of one's photo-real aerial imagery into the FSX default water class-based water 'textures', one must use either a ex: TGA or TIFF file instead of a BMP file, in order to use a 2nd Alpha channel.


IIUC, otherwise, one must set up a "Multi-source INF file" with the water area and Blend mask definitions in separate ex: TIFF image files.


PS: One might wonder if FSX SDK Resample may accept other file types (such as PNG ?) based on this info:


"Introduction: alpha channels - what they are/how they work:

Most RGB bitmap files are 24-bit, i.e. there are three 8-bit (256-level) channels, one each for Red, Green and Blue. The image combines 256 levels of each color to make a full color image containing up to 256*256*256 or 16,777,216 colors, often abbreviated to 16.7 million.

Some file types, TIFFs* and PNGs* notably, allow you to create and save an extra channel, making it a 32-bit image.

[Targa (aka "*.TGA") files can also include a fourth transparency channel, but PowerPoint doesn't recognize 32-bit TGA files.]

This extra channel, the alpha channel, isn't visible but acts as a mask to make certain areas of the image transparent in software that recognizes alpha channels.

And because this alpha channel is 8-bit, 256 levels, it can have 256 levels of transparency from black/100% transparent to white/100% opaque.
TIFF files can also be CMYK, also 32-bit, but with no transparency channel.
"

http://www.pptfaq.com/FAQ00190_Adam-s_Transparency_Tutorial_-Alpha_channels_and_more-.htm


Hope this helps ! :)

GaryGB
 
Last edited:
Hello:

AFAIK, in SBuilderX the 'visual' part of a aerial imagery BMP must be 24-bit not 32-bit; use of a 32-bit image will result in a "water" attribute being superimposed onto one's aerial imagery.

The very .bmps SBX makes itself using add map > from background are 32 bit, whether water is rendered or not I'd speculate depends on the color of the alpha channel, at least that's how it works with .tifs (except that you can have multiple alpha channels, one representing your water mask and another representing the blend mask (40 bit? lol) which is how I do it every time providing the extra channels don't cause the .tif to exceed the 2 Gb limit).

Jim
 
Yep, all's good here. Figured out the white alpha thing when I tried cropping the map, leaving transparencies around where there's supposed to be default terrain. Turns out SBX took the transparency as to be the shimmering water effect. Round 1 left me with a flooded airport. Ha, live and learn. Thanks for the ye old assistance.

I'd forgotten where I originally saw this, but just found it again at ptsim's SBuilderX forum:

http://www.ptsim.com/forum/viewtopic.php?p=3478


"Post by luisfeliztirado » Sat Jul 07, 2007 11:35 am

Resample accepts a limited number of image formats.

Here is some information from Adam Szofran, developer in charge of terrain at Aces:

Geotiff and Alpha channels

Photoshop can add an arbitrary number of alpha channels to TIFF images, but of course it strips out the GeoTIFF tags which isn't too wonderful. The listgeo tool can be used to save the GeoTIFF tags before loading the image into Photoshop and the geotifcp can be used to put the tags back after Photoshop works its evil.

If that proves to be too much of a pain, then you can actually read the alpha channels (water mask and/or blend mask) from one or more separate files. I've attached an example showing how to do this. It's a modification of the DayNight_Variations example in the Terrain SDK. Unzip it into the Terrain SDK directory because it references some of the source bitmaps included there. The key thing is the use of Channel_BlendMask=[<source>.]<band> and Channel_LandWaterMask=[<source>.]<band> to pull channel data from different source files.

The masks are just regular 8-bit grayscale TIFF files (not GeoTIFF, although those would work too). Unfortunately, you can't use 8-bit grayscale BMP files with Resample but TIFFs work great.

Here are a few things to keep in mind about the land/water masks. White (255) is land; black (0) is water. If you want the default water color to show through, you must paint entirely black (RGB=0,0,0) pixels into the the source image containing the color channels. Anything other than black will be used as is but with reflective water effects. That's how we got the water colors from the satellite imagery of St. Maarten to show through near the shore. We used a blend mask to fade out the satellite image water colors and fade in the default water colors further offshore
.


Water Mask

With the FS9 Resample tool, the water mask punched a hole in your image to reveal default water beneath.

With the FSX Resample tool, we wanted to allow more flexibility, so we changed how the water mask works and we also added a blend mask. Now the water mask triggers reflective and specular water effects, but it doesn't punch a hole in your image. The benefit of this is that you can now paint the water any color you want. For example, if your source imagery contains murky brown swamp water, you can now get the muck to show up in FSX with reflections and specular effects.

If you'd rather just see the default water colors, you have to use a blend mask to punch a hole in your image to reveal the default textures below. Note, however, that the default textures revealed by the blend mask might not be water; they could very well be land textures! Therefore, if you want to guarantee that the blend mask will expose default water textures, you need to create a water polygon (a big square one will do) that covers the area where you want water to appear. For information about creating water polygons, look for the documentation of the shp2vec tool in the FSX SDK."


"And this from the Terrain S.D.K. documentation:

Notes on Acquiring Raw Terrain Imagery

More than likely, the image you want to use will be an aerial or satellite photo. The raw image must be either a 24-bit per pixel Windows .bmp file or a 32-bit per pixel Targa .tga file.
"


NOTE: The above quoted thread was the basis for a subsequent excellent tutorial by Luiz Feliz-Tirado:

"Make photo-real ground textures"

http://library.avsim.net/esearch.php?CatID=fsxsd&DLID=140539


...A pertinent quote from that tutorial:

"Source image formats

Resample will accept a restricted number of image formats, for example:

- 24-bit bitmaps (BMP)
- 24-bit TIFF (TIF)
- 32-bit TIFF (TIF)
- GeoTIFF files, that have geo-referencing information included (TIF)
- 8-bit grayscale TIFF (TIF)
- 8-bit grayscale GeoTIFF (TIF)
- 24-bit TARGA (TGA)
- 32-bit TARGA (TGA)
"

Hope this helps further explain how water may end up in a "land area" in the visual part of one's aerial imagery. :)


Jim: In light of the above info, I'm baffled as to why SBuilderX creates 32-bit BMPs during its (-internal-) work-flow. :confused:


GaryGB
 
Last edited:
I'm not sure either Gary, it's odd. To be honest I have never used SBX as anything but a source for imagery and an .inf with regard to photoreal, beyond that I've always just snatched the .bmp and .inf out of the work folder immediately after downloading, converted them to .tifs in PS (not geotifs of course), edited the .inf to reflect the changes, and then all further resampling was done by sending the .inf directly to resample.exe.

I just did a quick test, with PS CS2 I opened one of the SBX-generated .bmps and stripped away the alpha channel (which was all white). I then simply saved it, and on re-opening I see PS had added back the alpha channel except this time it was all black - possibly that might account for the "flooded airport" mentioned above, although I have no idea if Gimp handles alpha in the same manner upon save.

I then stripped the alpha channel again and this time did Save as where PS gave me an option of 24 or 32 bit with 24 ticked by default. Of course this time the alpha channel was not reintroduced, and I then opened the test project back up in SBX and successfully compiled the photoreal. I didn't check it in the sim but I did drag it into TMFViewer and it appears to be a normal photoreal like any other I've done and did not have a water mask.

Next I opened the .bmp back up in PS added the alpha channel back and did a quick water mask on it, saved as 32 bit, and recompiled again from within SBX. No problems, and in checking the .bgl in TMFViewer it appears you can indeed include your water mask as a channel within a .bmp - you just don't have the option of a secondary alpha channel for the blend mask. .tifs rule for that reason :) .

Nothing above was really unexpected, pretty much exactly what I thought would happen, but the other day I was playing with one and I can't remember the exact scenario but for some reason I wasn't able to get SBX to give me a compile option - it kept telling me that nothing was selected when clearly the .bmp was selected and I know I had it positioned correctly according to the accompanying .txt file SBX generates when it generates a map. Maybe that test sample of imagery was just too small or something, I'm not sure. That was odd behavior and I probably should retest someday and see if I can figure out what the problem was. Zzzzzz... With any luck I'll die before I get around to it, lol.

Jim
 
Back
Top