Users browsing this thread: 1 Guest(s)
Basics?
#2
First thing's first, you need to be familiar with bits and bytes, their hexadecimal representations (as well as hexadecimal representations of colour, and hence how bytes represent colour), and looking at files in a hex editor. Knowing things like endianess and how bytes are read as numbers (shorts, longs, etc) is helpful too. I've PMed you before and you seem to know a fair bit about this stuff but it also applies to anyone else who might be reading this.

Now, you need to understand that the majority of the time a digital image is little more than a collection of pixels (unless we're talking about vector images but let's not go there). Each pixel is assigned a colour, and so when you arrange them in the right order they give you the image.

There are two popular ways of doing this; with a palette or without one. The latter represents each pixel by its full colour value. So for a 32-bit colour image, each pixel would be 4 bytes (i.e. 32 bits).
The palette method is a bit different. Each pixel is just a number that points to a place in a palette, which contains that pixel's colour. This palette can either be in the same file or in a separate file. Depending on the size of the palette the pixel can take up a different number of bytes, but typically it doesn't go beyond 1 byte (since 256 colours is often more than enough for a single image). It can vary though. In any case, the advantage of this method is that you can save space by not having the same colour being repeated in the image; two pixels of the same colour can simply reference the same index in the palette with a single byte (assuming it's 256 colours).

In either case, the pixels are often stored in a linear fashion, one after the other. Files usually have additional information in them telling you how these should be arranged. The simplest way is simply giving a width and height, and then you just place the pixels from left to right in rows. Sometimes a height isn't even given, and you just assume that the height is whatever the image is when the pixels run out (i.e. pixel number divided by width).

That's a really really simple explanation of "the basics", this is the most simple format of the many, many formats that exist. There's no specific steps to follow really, it's more or less practice and experience. Looking into popular formats like BMP and PNG is helpful, and if you're a coder then looking at source code for programs that convert game image formats can help too.

EDIT: By the way, I haven't even mentioned compression. I suppose using palettes is a form of compression, but there are much more complex forms that aren't nearly as friendly.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply


Messages In This Thread
Basics? - by Struggleton! - 07-23-2015, 07:45 AM
RE: Basics? - by puggsoy - 07-24-2015, 01:38 AM
RE: Basics? - by Struggleton! - 07-24-2015, 07:34 AM
RE: Basics? - by Struggleton! - 10-03-2015, 01:51 AM
RE: Basics? - by Vipershark - 10-03-2015, 01:59 AM
RE: Basics? - by Struggleton! - 10-03-2015, 02:39 AM
RE: Basics? - by puggsoy - 10-03-2015, 07:34 AM
RE: Basics? - by Struggleton! - 10-03-2015, 12:53 PM
RE: Basics? - by puggsoy - 10-03-2015, 11:28 PM
RE: Basics? - by TGE - 10-04-2015, 09:18 AM

Forum Jump: