Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Photography > Photography > Re: File size q...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 9 Topic 11483 of 11580
Post > Topic >>

Re: File size question

by Rob Morley <nospam@[EMAIL PROTECTED] > Apr 10, 2008 at 09:09 PM

In article <u9k1d5-b122.ln1@[EMAIL PROTECTED]
>, SteveB 
pittmanpirate@[EMAIL PROTECTED]
 says...
> I take 640 x 480 pictures for real estate evaluations.  We use this size

> because they go through e mails quicker.
> 
> When I download them to my computer, and then put the mouse arrow on
them, 
> they always say 640 x 480, but the kb size varies.  Why is that?
> 
It depends on the content and the compression level and image format 
used.
Consider the most basic way you could store the image - 640x480 is 
307200 pixels.  Each of those pixels has a level of red, green and blue 
light.  If each colour can have one of 256 levels you can store its 
information in 3 bytes, so the file size will be 921600 bytes or 900kB 
(plus a few extra at the start of the file to say what sort of image it 
is, that it's 640x480 pixels and 3 bytes per pixel).  Thats a basic 
uncompressed bitmap image.
Now consider what happens if several consecutive pixels have the same 
value - instead of representing each one, you can just give the value 
for one pixel and the repeat count.  With the uncompressed bitmap you 
always need 3 bytes per pixel, but using this method (called run length 
encoding) you can represent up to 256 pixels using only 4 bytes, 1 each 
for RGB and one for the count.  The downside of this is that in the 
worst case you could end up using 4 bytes per pixel and produce a larger 
file because none of them is repeated, but even if only a quarter of the 
pixels are repeated once the file is no larger, and as soon as pixels 
are repeated more than once you start to save space.  That's a simple 
form of lossless compression - when decompressed again the image is 
identical to the original.
Finally consider what happens if a group of pixels are approximately the 
same value - after all, 3 bytes can store 16,777,216 different colours, 
and you probably don't need that many.  So take an average value of a 
few similar pixels, and store them as if they are all identical.  That 
can greatly increase the incidence of a run of pixels, further reducing 
the file size.  The problem with this is that you can't rebuild the 
image exactly from its compressed form - it's lossy compression, because 
some of the information about the original image has been discarded to 
save space.  This can sometimes be seen in highly compressed images - 
what should be a smooth gradation of colour, like a clear blue sky that 
lightens slightly towards the horizon, can actually be seen as distinct 
steps where the colour changes suddenly.
There are more elaborate compression methods (and other simple ones) 
usually working in two dimensions rather than just the one, and using 
complex mathematics, but those are pretty much the basics.
If you're interested you could download something like Irfanview (a free 
image viewer/editor) and experiment by saving different types of image 
at different sizes, compression levels and colour depths to see what 
effect it has on file size and the appearance of the image.




 9 Posts in Topic:
File size question
"SteveB" <pi  2008-04-10 08:20:39 
Re: File size question
"Ken Hart" <  2008-04-10 14:50:06 
Re: File size question
"SteveB" <pi  2008-04-10 21:33:21 
Re: File size question
Rob Morley <nospam@[EM  2008-04-10 21:09:26 
Re: File size question
Paul Furman <paul-@[EM  2008-04-10 13:25:05 
Re: File size question
"SteveB" <pi  2008-04-10 21:36:06 
Re: File size question
Paul Furman <paul-@[EM  2008-04-10 21:40:23 
Re: File size question
Joel <Joel@[EMAIL PROT  2008-04-10 15:42:45 
Re: File size question
floyd@[EMAIL PROTECTED]   2008-04-10 23:42:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 0:51:52 CDT 2008.