• Forum
  • Lounge
  • What designates image file format existe

 
What designates image file format existence?

Hey, weird title, I know.

I was wondering if anyone here has skill under their belt in designing, and working with multiple image file formats in computer programming.

For example, a .JPEG would be different than a .BMP in Windows, but share some alikeness.

Is it the binary data within that designates difference, or is it merely a standardized format that is loaded by dedicated image loading software?

Let's say, basically, a program like Microsoft Paint, regardless of version, will decode the binary data of an image file format, and show it on the canvas.

But what designates it? Is it binary data, file header info, metadata, etc.?

How does the program dictate the differences, unless they have different data?

If I made my own image format, I'd need to add-on to existing data, correct?

Either that or start from scratch, which is never easy....

PS: Why do I ask? I'm developing an operating system, painfully and slowly but working out thus far and learning constantly ... I can't use any already existing standardized image file formats or extensions, so I'd need to make up my own for testing purposes.
Last edited on
In most operating systems, there are only four ways you can know what format a file's contents are:
-File extension
-Header info/magic number at start of file
-Context of use
-Guess


Different image forums are used for depending on whichever is most advantageous for a goal. BMP is quick and easy to deal with and lossless, PNG is compressed and lossless and should always be used, JPEG is lossy but great for compressing real life images, GIF is horrible and should never be used, APNG is animated PNG like MNG but more poplar, and LB is very opinionated.
I don't see an answer to my questions in your response, L B.

No offense, but everything you wrote I already know well.

I didn't ask how I can find out what file format and contents are for and of use, I asked what designates it.
Last edited on
Then I don't know what you mean by "what designates it".
Last edited on
Windows for example will probably use the file extension and metadata to determine the file type and to associate an appropriate application to open it with. But said application should check the header to determine the exact image type, bit depth, etc...
Last edited on
Ah, are you referring to Windows File Association, where a file extension is associated with an application?
Most files start with a number/string that allows programs to verify their format. ELF executables on Linux, for example, start with the string "\7fELF" (\7f means the hexadecimal constant 0x7f).
L B, I am just talking about format, but most images carry extensions on file names. Not just on Windows, but Mac, Linux, etc.
Topic archived. No new replies allowed.