Understanding Digital Image File Mechanics


 

1) Pixel Dimensions & Resolution

In an image file, pixels are the small visible squares of color that make the H x W dimensional size of digital images.

Pixels derive their color signal from a set of numbers used to describe a color.

For most images, each pixel is a composite of a red, green, and blue value derived from an 8-bit or 16-bit sequence of 1’s and 0’s. These RGB values create the color for that particular pixel.

Grayscale images use only one sequence value (as opposed to three) for each pixel to represent the  level of black or density. This can be in 8-bit, 16-bit, or 32-bit depth.

A pixel in an RGB color space image gets its color from the composite of 3 "channels", one channel each for R, G, and B. A channel is a histogram of luminosity levels on a finite line from light to dark. (Bit depth describes how many discrete segments the line can have.)

A pixel in a CMYK color space image gets it's color from 4 channels composited together, one each for C, M, Y, and K.

A grayscale color space image has only one channel. It has no color bias and the white point  is the surface it's printed on or a result of the profile of device it's displayed on.

A single histogram by itself is greyscale.

Digital color happens when histograms are overlaid.

Magazines and books are often printed at 150 lines per inch, double the LPI to get the needed pixels per inch, so 150 LPI x 2 = 300ppi

An 8” x 10” image at 300ppi has a pixel dimension of 2400px by 3000px

so therefore,

2400px ( 2400px = 8” x 300ppi ) by 3000px ( 3000px = 10” x 300ppi )



2) Bit Depth

A bit is a 1 or 0

1 = on = black

0 = off = white

A byte is a sequence of bits, 1's or 0's.

The color bit depth is the number of bits used to represent a color value. Bit depth describes the degree of subtly a color can be.

256 color values - or shades of grey per channel - from 0 to 255, and 3 channels mean one pixel value is composed of 3^8 power = 24 bits.

(255, 255, 255) is pure white in RGB and (0, 0, 0) is pure black.

A red pixel can have 256 levels of red. A numerical value of 0 describes a complete absence of red, whereas the value 255 describes the fullest red that can be displayed.

0 - 255 = 256 amounts of density

8 bits = 256 bytes

255 characters + byte 0

255 = 0% k, pure white, or paper white point

242 = 5% k, white with some detail

15-20 = 90% k, black

20 = 90-92% k

12  = 95% k black, black with some detail

0 = 100% k black without detail

16-bit image depth has a greater range of color and black-to-white gradation steps. 16-bit image images can be interpolated to a larger dimension size with fewer visible steps in tone.

8-bit image depth has a smaller range, which can cause visible transition steps of gradations, most visible when printing. Interpolation and compression increases this effect.

E.g. In an 8-bit image one red channel pixel value has 8 1's or 0's in a sequence that make a single grey value. When composted together with a blue and green channel pixel color value we see a single “normal” color.

An 8-bit depth image has a sequence of 8 1's or 0's to represent 1 pixel per channel. Red, green, and blue are each one of the three channels.

By themselves they are grayscale, but overplayed they represent the color spectrum we see.

A 16-bit depth image has a sequence of 16 1's or 0's to represent 1 pixel per channel.

Bit depth is the number of tonal value possibilities of a pixel.

A pixel in an 8-bit channel = 2x2x2x2x2x2x2x2 = 256 shades of gray, and 3 channels overlap to make the color pixel.

2^8 power = 256 different colors levels for a pixel in each of the three basic colors (2^24 for all 3 RGB channels).

256 x 256 x 256 = 16.7 million color possibilities for a pixel.

An 8-bit RGB image, is 3 8-bit channels, 3x8, and is sometimes called a 24-bit color image.

A pixel in a 16-bit channel = 2x2x2x2x2x2x2x2x2x2x2x2x2x2x2x2 = 65,536 different color levels / shades of gray, and 3 channels overlap to make a pixel.

65,536 shades each of red, green, and blue

65,536 = 2^ 16 power

65,536 x 65,536 x 65,536  = 2.8 trillion color possibilities for a pixel.

A 16-bit RGB image, is 3 16-bit channels, 3x16, and is sometimes called a 48-bit color image

A CMYK image, 8-bit per channel,  8x4, is sometimes called a 32-bit color image.

3) Colorspace

Color space is a gamut and describes a range of colors.

AdobeRGB1998 color space is the most versatile for making print and derivative screen files. There are larger color spaces used by professional photographers like ProPhoto, but AdobeRGB1998 is the most common profile for master files of an image that people use when processing their camera's Raw files.

sRGB is less versatile but widely used for screen and print. This is often a derivative color space of AdobeRGB1998 because it's smaller. Most mobile phone cameras use sRGB and process the image file in camera to provide the user with a JPG file.

CMYK is the least versatile and most printer specific. This is almost always a derivative file color space made for or by a specific printer.

CMYK printing color spaces are standard physical print spaces and fit into the Adobe RGB 1998 color space except for the black detail.

CMYK color space fits into the sRGB color space except for the blue and green detail.

The green and blue spectrum are the human eye's most discerning color spectrum.

Grey gamma 2.2 can be used for black and white images to reduce file space since only one channel is needed when all RGB channels are aligned, not three- RGB is about 2-3 times the file space.

The ColorSync utility on Macs show color space relationships well.

4) File Type & File Storage Size

TIF and PSD file formats can be lossless, but file size is bigger.

TIF can compress with LZW lossless compression.

JPG is lossy, the amount of loss is decided by the user. Banding, sharper gradations, and pixilation can appear when printing or on screen.

If a JPG is opened and saved as a TIF or PSD no additional loss occurs. 

If a JPG is opened, edited, and re-saved as a JPG additional loss occurs. It’s not easy to know how many times a JPG has been re-saved and re-compressed.  The best practice is to only make a file a JPG once for end use specifications. 

Tiff and PSD are the standard editing file types. They are preferred for printing on paper, packing, etc.

Tiff and PSD are often assumed to come from a RAW file file that has been processed, but not from a JPG that has been uncompressed.

Tiff and PSD can be 8-bit, 16-bit, or 32-bit depth color.

JPG is the standard screen file type, which implies a JPG file is likely in the standard screen color space, which is sRGB color space, which is a smaller color space then Adobe RGB 1998.

JPG is always 8-bit color depth. The JPG file type doesn't support 16-bit color depth.

JPG is often a derivative of a TIF and PSD but rarely the reverse.

The compressed size of a JPG varies based on the compression/quality setting and image content. Areas of the same tone (same sequence of 1's and 0's) compress more than areas with detail (different sequences of 1's and 0's)

E.g. A 29.6 MB JPG of a colorful fish against black with least compression =

21" X 14.01" at 300ppi

6300px X 4203px

A JPG that opens in Photoshop as a 60 MB document is 60mb/3 bytes = 20 megapixels.

17.63" X 13.223" (or 5289 px X 3967 px) at 300 ppi = 60MB tif

12.47" X 9.353" (or 3741px X 2806px) at 300ppi = 30MB tif

File size depends on several factors in addition to image size and resolution. File size is not a measure of mechanical quality. It is an accurate measure of storage space and transfer speed.

If it's 8-bits per-channel a pixel uses 3 bytes, 1 byte per channel to represent a color.

If it's 16-bits per channel a pixel uses 6 bytes, 2 bytes per channel to represent a color.

For a TIF, a 6”x4” image printed at 300 dpi, the image size is calculated as:

(6 × 300 dpi) × (4 × 300 dpi) = 1800 × 1200 pixels

1800 × 1200 pixels is 1800 × 1200 = 2,160,000 pixels (2 megapixels)

The memory space for this RGB color image is:

1800 × 1200 × 3 = 6.48 million bytes or 6.48 MB for a solid tone TIF document with no compression.

The last "× 3" is for 3 bytes of RGB color information per pixel for 24 bit color (3 RGB values per pixel, one 8-bit byte for each RGB value, which totals 24 bit color).

Using LZW compression it reduces  file size by about 1/3.

Using JPG compression at the highest quality it reduces file size by about 2/3.

Compression amounts are image scene dependent.

5. Color Depth Bytes per pixel

1 bit Line art 1/8 byte per pixel (1 bit per pixel, 8 bits per byte)

8 bit Grayscale 1 byte per pixel

16 bit Grayscale 2 bytes per pixel

24 bit RGB 3 bytes per pixel

32 bit CMYK 4 bytes per pixel, for Prepress

48 bit RGB 6 bytes per pixel

6. Bit Depth

Bit depth = tonal values

1 on-black, 0 off-white

2x1 = 2 shades of gray = 1-bit b&w (1 b&w channel)

1 gs channel = 8-bit = 2x2x2x2x2x2x2x2 = 256 shades of gray

8-bit RGB = 3x8 = 24-bit color image

256x256x256 = 16.7 million colors = 3x8 bit gs channels = 24-bit color image

16-bit = 2x2x2x2x2x2x2x2x2x2x2x2x2x2x2x2 = 65,536 shades of gray

32,768 = 15-bit , needs 65,536 bit to fit

16-bit RGB = 3x16 = 48-bit gs in RGB image (2x Info as 8-bit?)

CMYK = 8-bit per channel = 8x4 = 32-bit color image

48-bit color is 3 16-bit channels

48-bit HDR color is a raw scan file

16-bit gs = 512 shades of gray (256 x 2)

2x file size as 8-bit gs

7. Resolution

Epson 10000 XL scanner, 2400ppi optical resolution, 3.8 density max

2^8power = 256 different colors levels for a pixel in each of the three basic colors (2^24 for RGB). Thus, a red pixel can have 256 levels of red. A numerical value of 0 describes a complete absence of red, whereas the value 255 describes the fullest red that can be displayed.

Resolution, ppi, needed is 1.5 to 2x the line screen, LPI, which is dependent in paper printing to.

Lower quality paper has more dot gain.

Lpi, # of lines/half-tone dots that are placed per inch, or Lpcm- per cm

Newspaper is 80-100 Lpi, magazines/books are 150-175 Lpi

Q factor is relationship between ppi & Lpi

Highest quality press printing the ppi is generally 1.5 to 2 x Lpi ... So a Q factor of 2 x 150Lpi = 300ppi

8. Average Skin tones: R > G > B

20 points separation from B < G

20-40 points separation from G < R

Eg. R 230, G 200, B 180

9. 0-255 = 256 amounts of density

255 k = 0% k light density

242 k = 5% k light density

20 k = 90% k dark density

12 k = 95% k dark density

0 k - 100%k dark density