Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Image file format questions

Name: Anonymous 2006-02-21 4:52

Here are 2 questions for you guys:

1) Today in my Imaging class, we were taught that 'file size' and 'size on disk' were different because 'file size' is the raw data of the file, and 'size on disk' is the whole size including file header/tags. I always thought it had something to do with clusters, but my teacher was having none of it... which is it?

2) We were also made to do an exercise using the TIFF format for saving indexed colour in decreasing amounts. The decrease in filesize from 256 to 128 colours was rather large as expected, then upon saving in 64, 32, and 16 colours, the file size was pretty much the same as 128. Why is this? Again, the teacher said this is due to lots of tags in the file header. He didn't elaborate, leading me to think he could be wrong.

Thanks in advance, and excuse my ignorance.

Name: Anonymous 2006-02-21 6:53

Your professor is an idiot at least for filesize.

Your analysis is correct. The answer is not simple, since different filesystems handle it in different ways, but it generally works like this: disk sectors usually are 512 bytes in size. In order to keep overhead down, most filesystems group sectors into clusters (or zones/blocks/whatever). You can only have one file per cluster, no more. So, since file data generally doesn't stop at convenient cluster boundaries, you usually end up with something known as "slack space", since a file, or the remainder of a file, doesn't take up the entire cluster.

Now, I'm not familiar with TIFF, but I suspect the reason you may not be seeing improved benefit with reduced colours is related to the type of image you're using. Is it mostly gradients (e.g.: an actual photograph), or is it full of flat areas?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List