Closed Thread Icon

Topic awaiting preservation: Bitmaps.... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24573" title="Pages that link to Topic awaiting preservation: Bitmaps.... (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Bitmaps.... <span class="small">(Page 1 of 1)</span>\

 
wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-03-2005 19:57

That's a shame, I was going to enter the colours competition, but I was completely isolated from the internet :/
Anyway during my sojourn (I think of it more as an exile....it was horrible) I had nothing to do. So I reverse engineered the bitmap format. No challenge at all with paint and a hex editor to hand.....hell no challenge at all under any conditions . For anyone that's interested, it's something like this:

42 4D 00 00 00 00 00 00 00 00 36 00 00 00 28 00 00 00 *width in hex* 00 00 00 *height in hex* 00 00 00 01 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *literal colour data* 00

colour data = precise reverse of normal top left -> bottom right
pad each line with 4-(line length % 4) pairs of 0s

If you actually have a look at the hex for a paint-created bitmap it sticks some other junk in there that didn't seem to do anything. So I took it out. The height and width here are meant to be up to ff, though I believe they can flow over to the left for larger images. So, I wrote a little proggy to convert the text output of my wraytracer (yes, that old POS, but it was the only image generator I had to hand, and was also quite fun ) straight into hex. Then,using XVI32:

However, that's no fun! It'd be much more interesting to straight output images, a la shingebis' gifplasma and quite a few other things recently. However, if I understand correctly, you need to convert the hex straight into the equivalent ASCII character....but 0x00 gives some sort of error :/. Like...if you try to have it as part of a variable, it just stops the variable (try it and it's clear what I mean). Is there any way round this? It'd be awesome to have it directly outputting the image

Sorry if this has all been gone over beofer, I know people have looked at xbmps (IIRC), but I haven't seen anything about this.

Any help much appreciated!!

Wrayal

Go to kimber-ja.demon.co.uk and click on the link to the raytracer!

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 01-03-2005 20:42

wrayal: That's cool that you reverse engineered some BMP by yourself. All the more that IIRC you're ~15yo.

However in Image generation using javascript / and a hint for shingebis, which I recommend you to read if you haven't yet, you'll find a link to wotsit.org with the specs of many file formats ( including BMP ), and the ugly texture generator I did few months ago. That script generates a BMP image in JavaScript and doesn't suffer of encoding problems. Alas it's only supported well by Gecko browsers.

Well, since the discussion in the thread about image generation I've experimented some stuffs and am considering to enter the browser demo competition in the next Assembly demo party.

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-03-2005 20:55

Hehe, 16 now, but thanks . The reverse engineering was particularly clever (but then, I hang around NDS and xbox hackers so something like that was always going to feel insignificant). Thanks for the links, I'll have a look at them all!

Wrayal

Go to kimber-ja.demon.co.uk and click on the link to the raytracer!

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-03-2005 21:11

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 01-03-2005 21:47

I certainly don't feel that you're insignificant. Making a raytracer at the time you did is a very difficult thing (I taught myself trig back in 9th grade by making a raycaster, so it's fairly comparable).

Keep plugging away and never stop learning.

Now, I really ought to look into all of this image generation stuff... I've done XBM's, I should move into other things...

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 01-03-2005 21:56

InI: Nope I haven't made it cross browser. I'm playing with the data: URI scheme which IE doesn't even support, and Opera only accept a base64 encoding with certain MIME types and seems limited to URIs of ~4Kb.

Btw, happy birthday Iron Wallaby! how old are you now ?



(Edited by poi on 01-03-2005 21:57)

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-03-2005 22:07

OMG! IT WORKS!!!

OK, I've got it outputting a picture thanks to your script poi! I think you guys misunderstood slightly, I'm not a complete pessimist or anything, don't worry
However, there is _no_ way you guys are seing the code as is. Give me two minutes and I'll produce a slightly less inelegant set of code than I have at the moment and post it. Thanks so much for all your help!!

Wrayal

Go to kimber-ja.demon.co.uk and click on the link to the raytracer!

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 01-03-2005 22:17

poi: I turned 18 at 10:42 EST this morning.

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-03-2005 22:35

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-03-2005 22:59

Forgot to say: happy birthday IW!

OK, here we go, a POC.
Put it this way, on a 2.8ghz machine, I got about 4 warnings about mozilla possibly becoming unresponsive due to a heavy script a 40px res. There's lots of stupid stuff. EG, I put in the code to make sure it aligned the bytes along a 4 but boundary....then later decided to just shift the res by a couple of bytes, because it became significantly easier. So it's a huge bodge. But it works.

http://www.wraypa1.f2s.com/total.html

Wrayal

Go to kimber-ja.demon.co.uk and click on the link to the raytracer!

(Edited by wrayal on 01-03-2005 23:00)

TwoD
Nervous Wreck (II) Inmate

From: Sweden
Insane since: Aug 2004

posted posted 01-04-2005 19:36

Wow! I had no idea you guys were my age! I'll be turning 19 the 14th

I wish I had as impressive scripts as you guys have, the only "real" project I have to show is the 2D Vector engine I created for Naltabyte AB.
I'm not allowed to show the source code though. (atleast I think I'm not, better be on the safe side lol)
You can see some examples of what the first official version is capable of at www.naltabyte.com, however the new version is much more efficient and flexible.

Wrayal: I can't see the pictures since I'm using IE but on my 3ghz Win XP machine I get no warnings and it takes 30 seconds to render with the default settings.

Happy Birthday IW!

/TwoD

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-04-2005 23:25

Yeah, IE seems to render a lot more quickly. In fact, IE seems to have speed advantages in many areas. But...it doesn't comply to standards so the picture doesn't display and...wait, this isn't an IE bashing thread. But yes, it's not too slow in IE.

Wrayal

Go to kimber-ja.demon.co.uk and click on the link to the raytracer!

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-21-2005 22:50

Hate to bump and old thread, but (can't be bothered to re-write so quoteing front page) "Well, I've done it. 5K with moz and IE support, and bmp output in moz. Note, status bar code has been disabled, as it caused a _MASSIVE_ hit on speed. You can simply uncomment the one commented line in the script if you want it back."

http://www.wraypa1.f2s.com/wrayal/5KWraytracer.html



My Website (finally! And yes, it uses frames and is evil, but, well, take a look, it's not as evil as you might think )

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 01-21-2005 23:06

Neato!!

When the Image generation using javascript / and a hint for shingebis thread was hot, I turned the Wrayal's 20 lines JavaScript Raytracer continued into BMP rendering to see, but didn't consider to put it online as this 20 lines JS raytracer was/is not accurate



(Edited by poi on 01-21-2005 23:07)

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-21-2005 23:10

Lol, your skill is simply _insane_. not accurate - as in fudged shadows?
Oh, and I like your new site - very nice! Thanks for the link to mine, though yours kinda puts mine to shame

Wrayal

My Website (finally! And yes, it uses frames and is evil, but, well, take a look, it's not as evil as you might think )

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 01-21-2005 23:19

You underestimate your skills. Take a breath, and watch the pic you just posted, forget that YOU are behind it for the next 30 seconds and try to judge it ( and the code to generate it ) objectively. It just rock.

Glad you like my site.

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-21-2005 23:27

Thanks. Really. Sometimes I just ignore what I do and become too competitive or whatever. Looking at it I kinda feel proud

[I forgot one problem - >255 Res images will not work in Moz (actually, any greater than 252 technically due to bodge code). I will fix this at some point over the next fwe days, recompress, then try to let it lie and go after something else ]

Wrayal

My Website (finally! And yes, it uses frames and is evil, but, well, take a look, it's not as evil as you might think )

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-22-2005 00:28

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-22-2005 11:50

Yeah, sorry about the whole whining thing. Intermittently, I really lack self confidence - so if I whine, please just ignore it

And, thanks

Wrayal

My Website (finally! And yes, it uses frames and is evil, but, well, take a look, it's not as evil as you might think )

DmS
Maniac (V) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 01-22-2005 12:11

Wrayal, very, very cool indeed!
Plus, it does work just fine in Safari on OSX as well, just so you know...
/Dan

{cell 260} {Blog}
-{ ?Computer games don?t affect kids; I mean if Pac-Man affected us as kids, we?d all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music.? (Kristian Wilson, Nintendo, Inc, 1989.) }-

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-22-2005 12:53

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-22-2005 13:50

I guess it might actually. One of my friends tested it for me in Konqueror a while ago and said it didn't work, albeit that was before some of the latest changes. I'm not sure - my sniffing code is basically what "navigator.userAgent.indexOf('MSIE')" return. -1 -> attempts to output a bitmap, any other value -> does it by the old method. I'm guessing konqueror must therefore return a non -1 value, as when my friend tested it, it outputted a bmp by default and that didn't work. Well, either way, I'll try and do some extra testing.

DmS: can you right click and save it as if it were a real image?

Wrayal

My Website (finally! And yes, it uses frames and is evil, but, well, take a look, it's not as evil as you might think )

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 01-22-2005 15:22

for the BMP output, you'd rather base it on navigator.userAgent.indexOf('Gecko') as though Opera supports the data: URI scheme, it doesn't like the ISO-8859-1 encoding ( and require base64 ) nor the URI longer than ~4Kb.

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 01-22-2005 16:51
quote:
InI said:

...if it works in Safari, it should work in Konqueror on Linux as well...


I find it's the other way around. If it works in Konqueror, it works in Safari. I have found a few things that work in Safari but not in Konqueror -- it appears that Safari is further in development than Konqueror, though the two are pretty close together.

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

DmS
Maniac (V) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 01-24-2005 21:03

Sorry 4 the delay Wrayal.
Yup it behaves just like any other image on mac.
The only thing is that it doesn't have a name, it's recognised as a bmp though.

/Dan

{cell 260} {Blog}
-{ ?Computer games don?t affect kids; I mean if Pac-Man affected us as kids, we?d all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music.? (Kristian Wilson, Nintendo, Inc, 1989.) }-

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 01-24-2005 21:31

DmS: don't worry about it, and thanks . Well, that's pretty cool. bmp output in Safari as well. Like I say, as soon as I have some time off (5 A-level subjects != copious free time) I'll do some more testing. And I still wana sort out that bug in Moz, though somehow I don't think there are gona be many people rendering images of that size....

Speaking of which, the JSON thing on slashdot led to me looking at XMLHTTPRequest and so on. I used cgi for a distributed networking program I wrote a while ago, but this would be significantly better. The relevance? Getting my computers to do a collaborative effort on some rendering

Wrayal

My Website (finally! And yes, it uses frames and is evil, but, well, take a look, it's not as evil as you might think )

« BackwardsOnwards »

Show Forum Drop Down Menu