Specs for various image formats?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Specs for various image formats?

Post by Zacariaz »

When i wiev an unconpressed image, let say 16*16px tiff, i an hex editor, i certainly see the various pixel values as they should be, however there is also alot i can figure out. Futher more i also need alpha, so where can you find these sorts of information and which image format (uncompressed with alpha) would you recomend?
This was supposed to be a cool signature...
Laksen
Member
Member
Posts: 140
Joined: Fri Nov 09, 2007 3:30 am
Location: Aalborg, Denmark

Post by Laksen »

Generally www.wotsit.org is a nice place for information about fileformats

I would recommend TGA
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

I also would recommend TGA (uncompressed) or BMP (32-bit BMP formats are possible, btw).
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

You can store uncompressed PNG, too - but your software must support compression to be compliant to the PNG standard. Depending on where you want to go with your application, it could be a viable decision to start with PNG as a format you're likely to implement later on anyhow.
Every good solution is obvious once you've found it.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

I also wold like to use png, but uncompresed formats just seemed easier to work with. This might change though, as i learn more.
This was supposed to be a cool signature...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

As I said, PNG can be stored uncompressed too.
Every good solution is obvious once you've found it.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

i am reading the specs as of right now, ive done 40 pages and still only have figured out 20 byte of the header (more or less) My head hurts :shock:
Anyway, it seems not to be too complicated, but i probably wont be done with it today.
Solar wrote:As I said, PNG can be stored uncompressed too.
yes...
What i did was creating a small image with gimp, with some easily recognisable ( sorry for my spelling) pixel values, however when i view it in the hex editor it isn't. As i understand it, no filtering has been used, so that shouldn't be the problem and that goes for compression and interlacing too. This information is gathered from the the file itself, not gimp.

I guess i will come upon a explanation sooner or later.
This was supposed to be a cool signature...
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

didn¨t help much, trying pnglib.org for more info.
This was supposed to be a cool signature...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Note that uncompressed PNG aren't exactly commonplace, it's a border case. Sorry if suggesting it did confuse you.
Every good solution is obvious once you've found it.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

I'm actually making progress, what is bothering me is a few things like if i create an image in an apropiate program, draw a pixel with a specific value, fx. 0xFF9933, then save it without compressing it, i would expect to find that exact value somewhere in the file when viewing it in a hex editor, but i don't.

Also the maximun allowed bit depth is 16, which doesn't make sence to me. If it where 8 or 24/32 it would, 8 per color or 24/32 in total. To me 16 only makes sence if we ara talking greyscale with alpha, but in that case a bitdepth of 8 is actually alowed. This leads me to conclude that we can work with pictures with a bitdepth 48 as oposed to 24 which i believe is normal.

there is a number of thing i don't understand, probably because iv'e missed something. Im sure i will get it eventually, but still, it makes my head hurt.
This was supposed to be a cool signature...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

I am not a master of the PNG format, but I know it offers:
  • 256-color palette-based,
  • greyscale with 1, 2, 4, 8 or 16 bit;
  • RGB with 8 or 16 bit per channel (Red, Green, Blue, Alpha, for a total of 24 or 48 bit / pixel).
48 bit per pixel isn't that extraordinary. I think you are confusing the 24 / 48 bit per pixel of PNG with the 8 / 16 / 24bit of graphics cards... which are two very different things. ;-)
Every good solution is obvious once you've found it.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

Solar wrote:48 bit per pixel isn't that extraordinary. I think you are confusing the 24 / 48 bit per pixel of PNG with the 8 / 16 / 24bit of graphics cards... which are two very different things. ;-)
Ok, i need to read up on that because i have no idea what you are talking about. Sure i know about the graphic card, but i have never heard that a image format could infact handle more than 24 bits (32 with alpha), not any regular formats anyway.

I would never need more that 24 bits if its just for use on my computer i supose?

I have actually found my pixel value by now, but that means that i still have 12 bytes left that i haven't got a clue what means.
here is the raw image data:

78 01 01 04 00 fb ff 00 11 22 33 00 ae 00 67

The bold values are of couse my pixel value and the 0x00 following could be an alpha value, that is it cannot as the IHDR header specifies otherwise.

Still i have come a long way since: "haven't got a clue."
This was supposed to be a cool signature...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Zacariaz wrote:Sure i know about the graphic card, but i have never heard that a image format could infact handle more than 24 bits (32 with alpha), not any regular formats anyway.
TGA, PNG and a couple of others.
I would never need more that 24 bits if its just for use on my computer i supose?
If you think Counterstrike, no. If you think Photoshop, definitely. Astronomical or medical images, for example, undergo heavy postprocessing, and you need every bit of information you can get.
Every good solution is obvious once you've found it.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

I would never need more that 24 bits if its just for use on my computer i supose?
If you think Counterstrike, no. If you think Photoshop, definitely. Astronomical or medical images, for example, undergo heavy postprocessing, and you need every bit of information you can get.[/quote]

the answer then is no ;) while i do from time to time look at pictures taken by the hubble space telescope i don't download those "above 100 megs" pictures, i don't want to wait 8 hour just to open it...

Anyway, im at a standstill in my PNG investigation so anyone who might have some experience, specificly regarding the IDAT chunk, i would really appreciate some help.

Regards
This was supposed to be a cool signature...
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Specs for various image formats?

Post by Dex »

Zacariaz wrote:When i wiev an unconpressed image, let say 16*16px tiff, i an hex editor, i certainly see the various pixel values as they should be, however there is also alot i can figure out. Futher more i also need alpha, so where can you find these sorts of information and which image format (uncompressed with alpha) would you recomend?
Why do you not just make your own simple raw format with alpha channal ?, i have written a program for my OS, that take most image formats (jpeg, gif, bmp) and changes them to a format that as the first 2 dwords XY sizes and the rest raw hex of the 24bit color.
You could easy use 32bit and use it for alpha info.
To start with if you code it for a OS like windows or linux, you can easy use libs to convert it from any file format to your format, and use the raw data thats in memory to convert to your image format.
Attachments
Music.asm
Here is the output from a 32x32 bmp image.
(16.85 KiB) Downloaded 72 times
Post Reply