OT questions about bmp file format

ok heres the scenario. i have this routine that i wrote that takes a bumpmap and tesselates polygons and applys the bumps to them based on texture coordinates. like a 3d bump map. so the objects geometry actually changes. anyhow how i’m getting the bump map is… i have this routine i got out of my computer graphics textbook that reads in bmp files. i haven’t looked inot how the headers works. so sue me. anyhow so i take a desaturated 24bit image and then write just the first color component(red) to a txt file as binary to get a heightmap. but the problem is it works fine as long as the edges in the bitmap are sharp. but if i use an image with blured gradiated edges i don’t get the same ordering in my file. so i assumed that bitmaps are uncompressed. but there must be some kind of compression going on. i’ve really racked my brain over this alot before noticing that its just gradiated images that don’t work. if anyone can explain this i’d apreciate it.

Why would you intentionally post an off-topic message? At the same time, why would you intentionally post an off-topic message about something that can easily be found via a www.google.com search to an Advanced OpenGL coding board? Not only that, I’ll bet that MSDN has the entire .bmp format somewhere in it. So, in short, why do you want us to do your work for you?

Firstly; what do you mean by the same orderings? It seems to be that all you are doing is converting an RGB BMP image to a binary file with just the red values (although you may apply some scale to those red values).

Secondly; if you really want to know if the file you have is using compresison then 1) don’t be lazy (read abtou the bmp specs!), or 2) check out the size of the file. If its big, then its unlikely to be compressed.


sorry i’m one of those take only that which is necesarry and give all that one can type. i probably won’t ever post here again. why would anyone not intentially post an off topic question is beyond me. but anyhow i have a task at hand and i’m just looking for a quick answer. not a subquest if you catch my drift. i give up.

also if you already know the answer… then its not really doing work for me is it. unless you are one of those types that thinks everything comes with a price. i hear in a far off land people are into helping people you know if you are into that type of thing.

[This message has been edited by wildeyedboyfromfreecloud (edited 03-18-2002).]

i consider myself the least lazy person on the planet forgive my ego. i seek to achieve maximum results. so yeah i stand on the shoulders of giants whenever possible. as for ordering i mean. i have a real envolved windows bmp loader with all the bells and wistles. maybe i also looking for an alternative. i’m really not in the mood to learn all about bitmaps this week it wasn’t in my agenda. anyhow you know i don’t know. this is really pretty crazy. but anyhow this function reads in the rgb components and stores them in an aray of rgb vectors. then i just take that structure and write it out to a file. just the red components as binary. and everything works Aok unless i go and use an image with soft edges. then everything slips. like the data is not stored in the logical order for an uncompressed image. (1scanline after the other). well anywho if no one has any ideas. i’m looking for an easy answer for now. ahh just forget it. i won’t bother again… one of these days i’ll wise up.

personally i’m worried i’m going insane. but here is how it works. if i draw a bitmap. say i just use circles with no softedges. i can draw as many as i like any color and everything is lovely. but if i saw perform a low pass (blur) over it then save it and run the program the bump map is all wrong. i also have the bumpmap textured onto the object so its easy to see where is should be bumping and mapping if you know what i mean. why could something crazy like this happen. i don’t think the file is compressed. and i don’t see why it would matter if it was. anyhow anyone have any suggestions that apply to this dilemma. i hear photoshop allows one to export a bitmap as a raw data file. i will try to get my hands on a copy i guess. if i was going to learn about image formats. i’d just make my own. i plan to do a lot of experiments in data compression. i’m just not comfortable using other peoples code or methods for some reason. well this is crazy just to let you know. hope someone got a kick outta it.

I wanted to contact you personally, but you do not supply an email address. Don’t take this personally, but you should really read this before posting anywhere. You will find that you will find the information that you require much more efficiently. Since this is an off-topic post, please refrain from replying on the board. My email is available through my profile. But, please, please, please, please read the linked document. But more importantly, follow the advice of the linked document. I learned these lessons the hard way. It seems that you are following a similiar road.

hehe, how many times you have already posted off-topic threads ??? 90% of you total threads posted ??? but here what you are doing wrong:
1st. bmps are stored uncompressed if they have more than 4bit per pixel !!!
2nd. bmps are stored in down-top order
3rd. bmp lines are aligned to 4byte boundarys
4th. opengl only takes bitmaps if they have size of 2^n x 2^m
5th. use ijg, then you can load jpg, bmp, gif, PPM, Targa(ignores alpha), and RLE(if you want)
6th. dont save a PSD file and rename it to bmp !!!
7th. if you only take the red component (which is 100% the blue component, because bmp is stored in BGR order, except you loader swaps them) you have to pass each line like:

save r-component-which-is-in-real-b-component
skip 2colorcomponents
while lineend
skip linesize%4
while linecount

Geez, you guys are a bunch of bloodthirsty sharks. I’m not impressed.

Then you’re not worth impressing

listen i want post here anymore. i’m very aware of how you all feel. i just don’t agree with it. i think you are all rediculous. this board is 5% questions. 15% answers. and 85% moaning and complaining. i’m just curious why you care. and i won’t follow this comment to its natural conclusion for concern for your emational well being. but i think you should all reconsider your priorities in life and your belief systems as well.

i’m tired of my mailbox being flooded with messages telling me i have replies that apply 0% to my question. and i thought my email would be there. but honestly i’m glad its not. like i said. crowds give me the creaps. i should follow my own advice. file this reply in the discontent furum. hmm… maybe there is a discontent bbs somewhere. where we can post all of our discontentions. and then be whined at if are discontentions are not discontent enough. honestly this is all rediculous. i think i need to reevaluate my relationship with humanity before i speak any further. and unfortunately i don’t have the time because you have all wasted my time, your time, and any poor soul who happened to stumble into this thread. think about your priorities. i’m not going to get philisophical or psychological here. i can give you some links though, kidding. geez. get some fresh air boys.



Ehy stupid jerk, read the posts other people write, they may want to help you!!!

Originally posted by wildeyedboyfromfreecloud:
this board is 5% questions. 15% answers. and 85% moaning and complaining.

So there is some overlapping (5+15+85=105)… Who the hell is answering or asking while complaining ??? You guys really should focus on moaning.



eric 28 more posts … and you are the winner

[This message has been edited by T2k (edited 03-20-2002).]

Originally posted by wildeyedboyfromfreecloud:
this board is 5% questions. 15% answers. and 85% moaning and complaining.

Then do not keep posting to this forum if it can not give answers to your advanced questions.


to your advanced questions

hehe …

wildeyedboyfromfreecloud, are you running some kind of religion, for which this is all a recruitment drive?

Anyway, I’ve done my guard duty for now - so no more moaning from me. Ask as many stupid questions as you like.

Originally posted by T2k:
eric 28 more posts … and you are the winner

Actually, some people have already blown the 1000 limit (Matt for example). If you count my posts on the old forums (before UBB), I must have reached something like 1500 already…

Anyway, I’ll have a pint after my 1000th post !



P.S.: to be honest, probably only 10-20% of those posts were useful to someone !

This site needs to can the advanced forum anyway. It just leads to elitism and snobbery and serves no purpose since everyone posts in both and everyone reads both.

It is enjoyable watching how persnipitty people get about their ‘precious’ advanced form, but overall the impact is negative and it is irritating.

Perhaps y’ll shouldnt be too hard on wildeyedboyfromfreecloud. It is likely that he does’nt have a lot of OpenGL experts about him so his only option is to go online. I have that problem too. Besides, how many user groups are solely dedicated to discussing the BMP format? … My guess: not many. My experience is that an OpenGL programmer is probably the best person to talk to about BMP file access …