Skip to Content

Relations between Kb and Pixels

Discuss and share your wildlife photography, filming and equipment
User avatar
bert
Distinguished Virtual Ranger
Distinguished Virtual Ranger
Posts: 14298
Joined: Thu Jan 13, 2005 9:02 pm
Location: mind in SA, body in The Netherlands

Relations between Kb and Pixels

Unread post by bert » Fri Nov 20, 2009 1:53 pm

Anybody knows
Is there any relation between Kb and Pixels
Say 15 kb (required in a avatar on the forum) is how many pixels?

User avatar
mfb
Junior Virtual Ranger
Junior Virtual Ranger
Posts: 42
Joined: Mon Feb 21, 2005 10:16 pm
Location: JHB

Re: Relations between Kb and Pixels

Unread post by mfb » Fri Nov 20, 2009 2:52 pm

Hi Bert

The simple answer no not really, because images can be compressed (eg.jpeg) or uncompressed (eg tiff) however there is a relationship because the more pixels an image contains the larger the file size but no exact way to say an image X size will be Y pixels.
The popular argument for destroying rather than protecting snakes is lack of knowledge, and yet there is no valid excuse for this - Austin James Stevens

User avatar
HoepHoep
Junior Virtual Ranger
Junior Virtual Ranger
Posts: 217
Joined: Thu Jul 27, 2006 3:52 pm
Location: Worcester South Africa

Re: Relations between Kb and Pixels

Unread post by HoepHoep » Wed Dec 02, 2009 4:48 pm

Hi

I believe there is a fixed relationship between pixels and size.
I square pixel equals more or less 2,9 bites.
Therefore an image of say 1835 x 2514 pixels = 4613190 square pixels will be a 13,3 Mb file if it is a .bmp file.

Jpeg are however a compressed format and even at 100% jpeg quality, that same file can be as small as 4,5Mb. I think that the actual image determines the actual compression that Jpeg can achieve and the final file size will therefore vary.

The relationship therefore only apply to .bmp files. I suspect that the RAW files will also follow this rule.
The Creator is bigger than His creation!

My latest trip report to Addo during June 2009:
http://www.sanparks.org/forums/viewtopic.php?f=27&t=34300

Sprocky
Posts: 1829
Joined: Wed Jun 10, 2009 8:51 am

Re: Relations between Kb and Pixels

Unread post by Sprocky » Wed Dec 02, 2009 6:12 pm

HoepHoep, I may have it wrong, but I disagree.

I work on uncompressed jpeg images that are in the region of 15MB, the same TIFF file is 50MB. The jpeg image will vary in MB depending on colour, contrast and density of the image. The TIFF however will stay constant if the dimensions remain the same.

Yes, very confusing. :doh: :?

User avatar
Switchback
Posts: 787
Joined: Mon May 04, 2009 9:32 am
Location: Northwold with KTP on my mind...

Re: Relations between Kb and Pixels

Unread post by Switchback » Wed Dec 02, 2009 7:47 pm

Another thing to remember is the ammount of colour information each pixel carries. A darker picture has much less information than a well lit or even overexposed picture. I did a quick test now. I took a picture with my camera in RAW. The ONLY thing I did was to almost completely over expose it and save it as a JPEG. I then took the same RAW file and almost completely under exposed it.

The over exposed picture was 4.7MB in file size and the under exposed picture was under 1MB. Both were 4288 x 2848 pixels at 300 DPI.

:hmz:
KNP: 14 June: Skukuza Camping
15 -21 June: Letaba Camping

User avatar
HoepHoep
Junior Virtual Ranger
Junior Virtual Ranger
Posts: 217
Joined: Thu Jul 27, 2006 3:52 pm
Location: Worcester South Africa

Re: Relations between Kb and Pixels

Unread post by HoepHoep » Thu Dec 03, 2009 10:22 am

Sorry guys, you haven't convinced me!

From searching the net the following seems to be the correct answer:
File size = (number of pixels) X (bit depth / 8)

But, this is not true of jpgs.
Remember that a jpg file with max quality settings, ie no compressing, is still a compressed file format! That means that all jpgs are smaller than the above size and always of a lower quality than a raw, bmp or tiff file. jpg-Compression use a complicated algorithm that makes it indeed impossible to predict the file size, even at max quality.

@ Switchback. What was the size of your raw file? Some cameras do 12 bit depth (per channel) raw files and the raw file size for your photo will then be 4288 x 2848 x 12 X 3 / 8 = 54MB. (photo's use red, green and blue (rgb) ie 3 channels)

If you save your raw file as a tiff file the size will be 18MB (tiff uses 8 bit per channel). This will be the size regardless of the colour information of the photo.

jpgs are however totally unpredictable.

Johan
The Creator is bigger than His creation!

My latest trip report to Addo during June 2009:
http://www.sanparks.org/forums/viewtopic.php?f=27&t=34300

User avatar
Switchback
Posts: 787
Joined: Mon May 04, 2009 9:32 am
Location: Northwold with KTP on my mind...

Re: Relations between Kb and Pixels

Unread post by Switchback » Thu Dec 03, 2009 10:47 am

HoepHoep,

I'm quickly looking at two RAW files at the moment. Both are as you said, 12-bit depth and 4288 x 2848 Image Size according to the Metadata. The one file is 11MB and the other 9.73 MB. If my RAW files were round about 54MB each, I'd have to buy a ton more memory cards! :big_eyes:
KNP: 14 June: Skukuza Camping
15 -21 June: Letaba Camping

User avatar
Switchback
Posts: 787
Joined: Mon May 04, 2009 9:32 am
Location: Northwold with KTP on my mind...

Re: Relations between Kb and Pixels

Unread post by Switchback » Thu Dec 03, 2009 11:32 am

Me too... :?

For me it is still about the ammount of information carried in each pixel. Let's use my camera's 12 Bit Image Quality. A bit is either a 1 or a 0, so, a 12-Bit file consists of 12 x 0's or 1's. Thus looking something like this for example: 111001100110

So, a pixle with more 1's than 0's will be larger. So, if all the pixels in a picture contain more 1's than 0's, the file will be larger that a picture who's pixels contain more 0's than 1's?

Or am I talking nonsense now? :hmz:

A bit of a definition about a bit:

"A bit is the basic unit of information in computing and telecommunications; it is the maximum amount of information that can be stored by a device or other physical system that can normally exist in only two distinct states. In information theory, one bit is typically defined as the uncertainty of a binary random variable that is 0 or 1 with equal probability."
KNP: 14 June: Skukuza Camping
15 -21 June: Letaba Camping

User avatar
Josh of the Bushveld
Junior Virtual Ranger
Junior Virtual Ranger
Posts: 1510
Joined: Tue May 19, 2009 2:15 pm
Location: Johannesburg - too far from the closest Sanpark

Re: Relations between Kb and Pixels

Unread post by Josh of the Bushveld » Thu Dec 03, 2009 11:42 am

Switchback wrote:Me too... :?

So, a pixle with more 1's than 0's will be larger. So, if all the pixels in a picture contain more 1's than 0's, the file will be larger that a picture who's pixels contain more 0's than 1's?

Or am I talking nonsense now? :hmz:

Yes :) Whether a bit is 0 or 1, it still takes the same amount of 'space'. You can't not have the 0s, else the datum wouldn't make sense.

I think it may have more to do with the range of colours, and how 'busy' the image is. At least this is for JPEGs in my experience.

Try comparing two RAW images, one that is really busy (lots of colours physically close together and one with fewer colours.
The 'mite formerly known as joshilewis

FGASA Level 1 Guide

Glen Reenen TR

15-18 June: Berg-en-dal

User avatar
Switchback
Posts: 787
Joined: Mon May 04, 2009 9:32 am
Location: Northwold with KTP on my mind...

Re: Relations between Kb and Pixels

Unread post by Switchback » Thu Dec 03, 2009 11:54 am

In the days when I still programmed PIC's (Programmable Integrated Circuits), the Memory on my EEPROM IC's (Electrically Erasable Programmable Read Only Memory Integrated Circuits) got fuller much quicker when more 1's were part of the language than 0's. I could view this when converting my code to binary.

So, from an engineering perspective, this makes sense to me that this applies to Digital Images as well. Although both 0's and 1's take up a unit of space, the data ammount of 1's are more than 0's.

Have made the comparison in my previous post.
KNP: 14 June: Skukuza Camping
15 -21 June: Letaba Camping

User avatar
HoepHoep
Junior Virtual Ranger
Junior Virtual Ranger
Posts: 217
Joined: Thu Jul 27, 2006 3:52 pm
Location: Worcester South Africa

Re: Relations between Kb and Pixels

Unread post by HoepHoep » Thu Dec 03, 2009 12:09 pm

Hi Guys

Yes it is very confusing.
I do agree joshilewis that a 0 take as much place as a 1.

But look at this colour: 111111000000
This colour can be represented with this algorithm 1(6)0(6). Now that takes much less space!

joshilewis, you are absolutely correct about the jpg way of compressing. It compares the colour of a bit with the adjoining ones and then calculate a new "average". The more the variation in colours the less the ability to "get away" with averages, hence the bigger the jpg. If you take a photo of white wall, jpg will compress it like you can't believe.

From the above you will understand that jpgs gave two problems:
1, you get pixelating. There are basically less blocks to make up the image and smooth curves become jaggery, (spelling?)
2 you loose tints. This is often most visible in your dark colours that became black and your light tints that get washed out to white. I always check the darkest part of the image to ensure that there is still detail, if not, the compression is to much.
The Creator is bigger than His creation!

My latest trip report to Addo during June 2009:
http://www.sanparks.org/forums/viewtopic.php?f=27&t=34300

User avatar
DuQues
Honorary Virtual Ranger
Honorary Virtual Ranger
Posts: 14520
Joined: Fri Jan 14, 2005 5:42 pm
Location: Red sand, why do I keep thinking of red sand?

Re: Relations between Kb and Pixels

Unread post by DuQues » Thu Dec 03, 2009 12:20 pm

Avatars....
Really simply explained that goes something like this:

The avatar is maximum 70x70 pixels. So that gives you 490 pixels. In pure black and white that would give you 490x2 (colours) = 980 bytes. Add a few things like the header of the file and such info, and you still get a tiny file.
However most people use a few more colours, like 16 million or true colour which is 24 bits per pixel. 490 x 24 11760 bytes, and added to that is the file info and such.

I played around a bit with this photo:
Image
and made this avatarsized cutout:
Image
(I think I used it as avvy a while?)

Now I saved it in a few formats, this is what you get:

5.955 meerkat_gif_256.gif (GIF format, interlaced)
5.960 meerkat_gif_256_normal.gif (GIF format, non-interlaced)
1.113 meerkat_gif_8.gif (GIF format, 8 colours)
6.379 meerkat_grey.gif (GIF format, greys only)
30.138 meerkat_jpeg_12.jpg (JPEG, full quality)
26.462 meerkat_jpeg_8.jpg (JPEG, normal quality)
14.764 meerkat_png_int.png (PNG format, interlaced)
13.101 meerkat_png_non.png (PNG format, non-interlaced)

So for avatars you are best off using PNG or GIF. As you can see the JPEG's, even at lower qualities are too large. GIF and PNG only use 256 colours, but it's more than good enough for avatars. Don't use it for your photos though!
Not posting much here anymore, but the photo's you can follow here There is plenty there.

Feel free to use any of these additional letters to correct the spelling of words found in the above post: a-e-t-n-d-i-o-s-m-l-u-y-h-c

User avatar
Josh of the Bushveld
Junior Virtual Ranger
Junior Virtual Ranger
Posts: 1510
Joined: Tue May 19, 2009 2:15 pm
Location: Johannesburg - too far from the closest Sanpark

Re: Relations between Kb and Pixels

Unread post by Josh of the Bushveld » Thu Dec 03, 2009 12:22 pm

HoepHoep wrote:Hi Guys

Yes it is very confusing.
I do agree joshilewis that a 0 take as much place as a 1.

But look at this colour: 111111000000
This colour can be represented with this algorithm 1(6)0(6). Now that takes much less space!

Sure, except the '(6)' takes up 3 bits anyway :) How do you encode that scheme anyway?

Physically, on a drive platter, CD, magnetic tape etc, a '0' takes up as much space as a '1'. It would be the same for transistors in any type of solid state memory. Not so?
The 'mite formerly known as joshilewis

FGASA Level 1 Guide

Glen Reenen TR

15-18 June: Berg-en-dal

User avatar
Switchback
Posts: 787
Joined: Mon May 04, 2009 9:32 am
Location: Northwold with KTP on my mind...

Re: Relations between Kb and Pixels

Unread post by Switchback » Thu Dec 03, 2009 12:45 pm

joshilewis wrote:Hahaha, have we driven you to that point? :)


Yip! :thumbs_up:

In terms of RAW vs JPEG in respect of post processing. A lot of people don't take pics in RAW format as they say it takes so long to do post processing. For me that is not true. If you have to crop, edit or do whatever anyway afterwards, it will take you the same time. Also, you can bulk convert all your RAW images to JPEG if you simply want to view them.

Just to give you another indication: The other day a guy was arguing with me that he can do all post processing in Photoshop on a JPEG as I can do on a RAW file. So, I took a picture of someone with the complete wrong White Balance. One in JPEG and one in RAW. Then I said lets see who's finished firsts correcting the white balance, I work on the RAW file and he on the JPEG, both in Photoshop. I was finished within 10 seconds. After 5 minutes he gave up... He came close, but not quit.

For me, there's no comparison, shoot RAW!! (And I can go on and on and give tons of examples why...) :wink:
KNP: 14 June: Skukuza Camping
15 -21 June: Letaba Camping

User avatar
DuQues
Honorary Virtual Ranger
Honorary Virtual Ranger
Posts: 14520
Joined: Fri Jan 14, 2005 5:42 pm
Location: Red sand, why do I keep thinking of red sand?

Re: Relations between Kb and Pixels

Unread post by DuQues » Thu Dec 03, 2009 1:02 pm

Josh, you missed out on one little thing....
With Lightroom you can edit JPEG's as well, including white balance etc...

However I agree with you, always shoot RAW! (Or DNG if your camera will let you.)
There is no reason to skimp on space, a 500 GB disk is almost the same price as one of 1 TB.
Not posting much here anymore, but the photo's you can follow here There is plenty there.

Feel free to use any of these additional letters to correct the spelling of words found in the above post: a-e-t-n-d-i-o-s-m-l-u-y-h-c


Return to “Wildlife Photography Enthusiasts”

Who is online

Users browsing this forum: No registered users and 2 guests


Webcam Highlights

Addo
Submitted by Dibles at 13:21:45
orpen
Submitted by Mrs. S.K.L.Gauntlett at 14:41:29
satara
Submitted by Mrs. S.K.L.Gauntlett at 14:38:54
nossob
Submitted by teddy_rsa at 12:50:33