DIP 9 65 Original 210 Eye Zoomed
DIP Original Blur Sharp Edges
Bits per pixel (bpp) Black color = 0
Image size Image size depends on: 1. Number of image rows 2. Number of image columns 3. Number of bits per pixel (bpp) Image size = rows * columns * bpp
Image size 1024 rows 1024 columns 8 bits per pixel (8 bpp) Image size = 8388608 bits Image size = 1048576 Bytes Image size = 1024 kBytes Image size = 1 MBytes
24-bit color format (RGB) 24-bit color format = True Color Colors are distributed to 3 color channels Color codes 8 Red (255,0,0) Green (0,255,0) 8 Blue (0,0,255) 8 Gray (128,128,128) (40,40,40) (207,207,207)
24-bit color format (CMYK) C – Cyan M – Magenta Y – Yellow K – Black CMYK is used in color printers Color codes Cyan (0,255,255) Magenta (255,0,255) Yellow (255,255,0)
RGB to grayscale conversion Average method Take the average of the three colors (R, G, B) Weighted method Takes into account the structure of the human eye
Average method Grayscale = (R + G + B)/3 The problem is that we take the average of three colors. Different colors have different wavelength and different contribution to image formation. In average method we took 33% of red, 33% of green, 33% of blue (each color have the same contribution to the image).
Weighted method New grayscale image = (0.3 * R) + (0.59 * G) + (0.11 * B) Contribution of red 33%, green 59%, blue 11%.
Example R = 206; G = 134; B = 84 Average method new pixel: Weighted method new pixel: X2 = 0.3*206+0.59*134+0.11+84=150.1=150 Weighted method usually gives brighter result.
Resolution For example: monitor resolution: 800 x 600 pixels smart phone resolution: 720 x 1280 pixels If the image has M rows and N columns, the resolution is M x N. Megapixels of the camera: 2500 x 3192 pixels pixel resolution = 2500 x 3192 = 7982350 bytes 7982350 bytes / 1000000=7.9=8Megapixels
Aspect ratio Ratio between the width and heigth of an image (for example 8:9, 16:10)
Example Aspect ratio 6:2, pixel resolution 480000 pixels. Calculate: 1. dimensions of the image 2. Size of the image Solution: c:r = 6:2 (aspect ratio) c*r = 480000 (pixel resolution) bpp = 8
Example c=6*r/2 c=480000/r (6r/2)=480000/r r=400, c=1200 Size=r *c*bpp Image size in bits: 400*1200*8=3840000 bits Image size in bytes: 480000 bytes=48kBytes