This is not correct.
Each pixel is made up of three color channels: Red, Green and Blue. This has nothing to do with image size or resultant file size. While the size of the pixel itself can vary, it will always be composed of these three color channels. Always always.
..
<sigh> It certainly is all correct, at least of JPG (the subject of discussion). 24 bits RGB is
exactly 3 bytes per pixel, always, always. 48 bits is 6 bytes, and indexed color is 8 bits (or less). JPG might be 8 bit grayscale, one byte. But JPG color is always 24 bits RGB.
The definition of 24 bits is three bytes, per pixel (bytes are 8 bits). So always, always for 24 bit RGB data (in memory, when not compressed in a file).
EDIT: I should have said the words of the obvious.
JPG is 8 bit channels, and three RGB channels, which is 24 bit color data.
Perhaps semantics, but Raw images only have one channel, which might contain red or green or blue data. Raw is not three channel RGB pixels (yet). However, I was speaking of JPG, specifically the JPG the camera makes.
A pixel has
no size in the image file, it is simply a color definition of a specific location, of unspecified area. The camera sensor sample did have an area for where the color sample came from, but which is of no use to us out of the camera. And printing will define some area for it when we print on a paper, but in the file, a pixel is just a dimensionless color definition, of one specific color. None of that was being discussed.
..
The JPG image format uses 8-bit color which means each color channel (R, G & B) is allotted 256 shades for that particular channel: 256 shades of Red, 256 shades of Green and 256 shades of Blue. Doing the math we see: 256 x 256 x 256 = 16.8 million (rounding up slightly). This is the total number of colors (16.8 million) any .JPG file can display. Ever. It's the limit of the file format. This number sounds impressive until you realize that most of our digital camera's are CAPABLE of 12 or 14 bit color (but *only* when shooting RAW). 12-Bit color renders 67 million shades of color, or four times as much as 8 bit color. I don't remember the numbers for 14-bit color and I don't want to do the math.
...
In this part, not much is wrong, but who said anything otherwise? What does it have to do with the subject of JPG Quality? I fail to see your point.
12 bits is 4 more bits than 8 bits, but each bit is a power of 2, so it is 16 times "more" colors. I did not read very close at first.
14 bits is 64 times more possible colors, but it is not combinations. In Raw, it is just red or green or blue, so we probably ought not assume every shade of red is in use.
Yes, RGB pixels will be built later by combining R, G, B from adjacent locations (for the JPG too). That is one shortcoming of digital sensors (Bayer limiting resolution), but really not much issue.
I was discussing JPG, which is 24 bit color, and so its RGB is always three bytes per pixel. This is pretty basic. And JPG compression does reduce that data size WHEN in the JPG file. Restored back into memory, it is three bytes per pixel again (if RGB).
Raw is 12 or 14 bits (smaller data than 24 bits), one 12 or 14 bit data per "pixel". But Raw is not RGB, its so-called pixel is only one color, red OR green OR blue (Bayer, etc). Which we cannot even look at it until we convert so it is RGB pixels (our monitors are RGB). The rear LCD on camera shows us a little embedded JPG for Raw, because its LCD display is also RGB.
...
Aaaaaaaanyway... Back to image size vs. file size.
Image size (aka "resolution") is dictated by the total number of pixels used to create the image. To calculate the megapixel size of an image you need to take the number of pixels wide and multiply it by the number of pixels tall. The resulting number, rounded to the nearest million, is the image's size in megapixels. That being said, I can record JPG's as small as 6MP on my D7100 (JPG Small = 2992 x 2000) or as large as 24MP (6000 x 4000). The D5200 can do the same thing, although the dimensions of the image are probably different.
File size (aka "how much space the file takes up on your hard drive") will be dependent on the number of MP's used to create the image but also on compression, if applied. RAW files are un-compressed, as are .TIFF files, which is why they are so much larger (in megabytes) as compared to .JPG files of the same mega-pixel size. This is because JPG is a compressed format that analyzes images in blocks of 8X8 pixels and selectively reduces the detail within each block to reduce file size.
....
Nikon has a couple of ways they compress NEF Raw, one of them is the Default. So your own Raw is mostly likely compressed that way, unless you used the menu to specify uncompressed Raw. One Raw compression choice is lossless. The lossy type is NOT JPG, and it is not really very bad at all.
TIF files (assuming 24 bits) and JPG, are
BOTH three bytes per pixel. Exactly zero difference. That is simply what RGB is. TIF24 and JPG24 are
Same exact data size (for same image size). ANY 24 bit RGB image is three bytes per pixel.
Including TIF, JPG, PNG, BMP, whatever, any type that can be 24 bits.
TIF from the Nikon camera are uncompressed, and is always 24 bit and three bytes per pixel. But otherwise, TIF can use compression, typically LZW compression, which is LOSSLESS, meaning no bad things ever happen. However, it must back away from the heroics to do lossless, so the efficiency is lower (less dramatic), and might be only say 70% or 80% of the original file data size. But since lossless, we can always get out precisely what we wrote into it. No losses. That's a big plus.
You might think of TIF as huge, but JPG data is exactly the same size (if both are 24 bit and both are same image size).
It is just that JPG ALWAYS does JPG compression which can be variable size IN THE FILE, but smaller files are always worse quality (and even JPG Quality 100 is still always JPG).
My previous that you didn't like was to point out the degree of how small the JPG file is, as compared to the actual original 24 bit data size it really is. We pay a price in image quality for that file size reduction. A small JPG file is NOT a good thing. Better quality to aim for the largest JPG file size, which is still mighty small.
Many instead shoot Raw, to bypass JPG artifacts for now, which is true, but that thought minimizes the other extreme benefits of Raw.
You left out the other "size" fundamentals.
Image size (pixel dimensions) Yes, there are menu choices. Default is Large Fine. And the sensor is Large. Nikon calls it 24 megapixels. So did I. We all know. It has nothing to do with Fine vs Normal JPG compression.
Data size (bytes). If 24 bit RGB (like JPG), then three bytes per pixel above. It IS exactly this size when in your computer memory, always, always.
File size - adds overhead to Data Size, Exif or format tags, etc. But can also add compression to be a much smaller file, JPG or LZW compresion for example. JPG always does. These choices have properties, benefits and repercussions. When opened again in computer memory, see Data Size.
Print size - the inches of paper we may print it on, not to be confused with anything else. The dpi number provides the scale to convert pixels to inches of paper, later when it is printed. Dpi is ONLY used for printing. Video and web shows pixels directly and "don't know, don't care" about dpi.
....
I hope that helps to clarify things a little.
....
Didn't help me a bit, sorry.