does any body know a .png or .bmp file configuration?

Non-platform specific questions.

does any body know a .png or .bmp file configuration?

Postby Sgt. Sparky » Wed Jun 13, 2007 12:20 am

does any body know a .png or .bmp(8-bit) file configuration?
I have tried using google and yahoo to find it but I cannot,
I am trying to add exporting files as a .png or .bmp depending on which I can figure out or get the configuration for. :D
my current Icon is made with my latest pixel art painting program. :D
http://game-editor.com/forum/tp-3662-Pa ... aker-.html
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Fuzzy » Wed Jun 13, 2007 2:25 am

png is... hard. bmp uses RLE compression.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Sgt. Sparky » Wed Jun 13, 2007 11:20 am

Fuzzy wrote:png is... hard. bmp uses RLE compression.

I am somwhere near a complete noob when it comes to that,
still:
I need to learn that type of configuration, my paint image reader function can barely load a .bmp(by that I mean the colours are all messed up. :( )
but I only made it to load .paint files(the type I made which are uncompressed.) but I am wanting the ability to export an image as a .bmp, I do not really need to read one.
(all I need are the basic properties of an 8-bit.)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Fuzzy » Wed Jun 13, 2007 5:59 pm

An uncompressed TGA 24 bit is about as easy as it gets. Try that.

Save one to disk, uncompressed, true color. Crack open your hex editor, and find the X and Y matching values. The other 16 or so bytes you can just copy direct. That does it for the header.

So you copy the 18 bytes at the beginning, replacing the values for the X and Y. After that append your RGB values, but they go in reverse order... BGR. if your image is 16x16, then you need to write 3x256 or 768 bytes after the 18 byte header.

When you go to load one, check the file length. It should be 786 bytes. If it matches, then you can check each element of the header. If they all match up, then read the body of the file(offset 18 from the beginning) to an array or 3 arrays, as you choose.

How about I write a function for read and write later today? I have a specialized one i can modify for you.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Game A Gogo » Thu Jun 14, 2007 12:23 am

I would help you sgt.sparky.
We could work together! sumer is coming for me (after tomorow) and I am willing to help you :3
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Sgt. Sparky » Thu Jun 14, 2007 1:47 pm

Fuzzy wrote:How about I write a function for read and write later today? I have a specialized one i can modify for you.

that would be Awsome! :D
I am way busy with doing a couple of projects right now,
so that would be very helpful!
I will add you in the credits(I will accually make some this time![I normally do not make them because I am always the only one on my projects. :(]) :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Fuzzy » Thu Jun 14, 2007 6:09 pm

I'm typing it out right now. I'll post it to here, rather than making a demo.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Sgt. Sparky » Thu Jun 14, 2007 6:30 pm

allright, I might not be able to test it for a while.
but can you make a writing sctipt to(or I may be able to figure it out because writing is pretty much the opposite of reading with some mods.)? :D
oh,
and I will put an opening credit towards you(for making the function),
what would you like your name to show up as?
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Sgt. Sparky » Thu Jun 14, 2007 6:36 pm

Game A Gogo wrote:I would help you sgt.sparky.
We could work together! sumer is coming for me (after tomorow) and I am willing to help you :3

I would be glad for the help but I am quite busy. :(
what part would you like to help with?
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Thu Jun 14, 2007 11:18 pm

saving the files?
I'm going to check for reference, if I was able to write a wav file, I'm sure I will be able to read/write a bmp and a png.

I know bmp are written backwards also :P thats why it loads from teh bottom on the internet
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Sgt. Sparky » Tue Jun 19, 2007 5:23 am

Game A Gogo wrote:saving the files?
I'm going to check for reference, if I was able to write a wav file, I'm sure I will be able to read/write a bmp and a png.

I know bmp are written backwards also :P thats why it loads from teh bottom on the internet

the wave file did not work though. :(
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby DocRabbit » Tue Jun 19, 2007 10:30 am

Here is a link to a good explanation of the .bmp structure if this will help any.

http://www.fortunecity.com/skyscraper/w ... ffrmt.html
User avatar
DocRabbit
 
Posts: 114
Joined: Fri Oct 27, 2006 2:56 am
Score: 10 Give a positive score

Postby morcior » Tue Jun 19, 2007 1:31 pm

256-Color Bitmap is an pretty easy format to write and load, and no it does not use compression.

The file structure is a header, then an array of RGBA components (4 bytes), and finally the picture array as an array of 1-byte color references. The link above describes it perfectly.

Recreate the BITMAPFILEHEADER and BITMAPINFOHEADER structs in GE (you'll find c++ code for this with a quick search, or construct them yourself using the data from the above link).

Then its simply a case of populating the structs, dumping them to file, writing your color table (you'll probably want to write this table out manaully to a standard 256-color palette and use the same for each image), dumping that to file, and then dump your image as 1-byte color table references.
morcior
 
Posts: 83
Joined: Fri Jan 12, 2007 12:16 am
Location: UK
Score: 9 Give a positive score

Postby Sgt. Sparky » Tue Jun 19, 2007 6:45 pm

thank you, I may give that a try in a week or so(I just moved and alot of family and friends are coming to visit.)
:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Wed Jun 20, 2007 2:00 am

Sgt. Sparky wrote:
Game A Gogo wrote:saving the files?
I'm going to check for reference, if I was able to write a wav file, I'm sure I will be able to read/write a bmp and a png.

I know bmp are written backwards also :P thats why it loads from teh bottom on the internet

the wave file did not work though. :(

It did work, its just the 22100Hz has odd behavior.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest