Transcript Image File
Image Technology Department of Computer Education KMITNB Types of Images • Raster Image – – – – Digitize or sampling from the real world Store in bitmap orientation Need large storage and High compression Edit by retouching tool • Vector Image – – – – Synthesized image Store in object structure list (Smaller) Reusable , Scalable , Animating No stair problem 2 Types of Images • Raster Image 3 Types of Images • Vector Image (xmin,ymin) Object Rectan01 Pivot center Data (xmin,ymin,xmax,ymax) Rectangular (xmin,ymin,xmax,ymax) begin lineto (xmin,ymin,xmax,ymin) lineto (xmax,ymin,xmax,ymax) lineto (xmin,ymin,xmin,ymax) lineto (xmin,ymax,xmax,ymax) (xmax,ymax) end 4 end object Types of Images • From vector to raster display system 5 Displaying Image in Computer • Cathode-Ray Tubes and LCD panel 6 Displaying Image in Computer • Source of color 7 Displaying Image in Computer • Source of color in CRT 8 Displaying Image in Computer • Color Mixing in RGB model 9 Displaying Image in Computer • Raster scan display system 10 Displaying Image in Computer • Raster scan display system 11 Displaying Image in Computer • Raster scan display system 12 Displaying Image in Computer • Raster scan display system 13 Type of color display system • True Color system – 24/16 Bits each pixel – 3/2 Bytes per pixel – Keep Color intensity in Frame buffer • Index Color system – 8 bits (1 byte) per pixel – Display 256 from index table at a time – Keep address of table in Frame buffer 14 Type of color display system • True Color system Bit depth Video controller N CRT M 15 Type of color display system • True Color system – – – – VGA 24 Bits 640*480 = 307200 Pixels = 921600 Bytes VGA 16 Bits 640*480 = 307200 Pixels = 614400 Bytes SVGA 24 Bits 800*600 = 480000 Pixels = 1440000 Bytes SVGA 16 Bits 800*600 = 480000 Pixels = 960000 Bytes 1 Byte 1 Byte 1 Byte 1 Byte 1 Byte 16 Type of color display system • Index Color system 17 Type of color display system • Index color system – VGA 256 Color 640*480 = 307200 Pixels = 307200 Bytes Index table 256*3 (24 bits) 768 Bytes Total 307200 + 768 = 307968 Bytes – SVGA 256 Color 800*600 = 480000 Pixels = 480000 Bytes Index table 256*3 (24 bits) 768 Bytes Total 480000 + 768 = 480768 Bytes – SVGA 256 Color 1024*768 = 786432 Pixels = 786432 Bytes Index table 256*3 (24 bits) 768 Bytes Total 786432 + 768 = 787200 Bytes 18 How to display an image file(1) • BMP indexed file structure 19 How to display an image file(2) • Step 1 Load image information 20 How to display an image file(3) • Step 2 Load color index to video pallet 21 How to display an image file(4) • Step 3 Load pixel information by lookup color pallet 22 Image capturing How to capture the image Analog to Input/ CCD Digital MemoryOutput Array Converter Interface Computer or Printer D Scanning to 2D Bitmap Picture 24 How to capture the image 25 Sampling an Image Sampling in Digital Camera 26 Sampling an Image • Resolution of sampling image from the real world Real world Sampling Output 27 How to scan the image Analog toInput/ CCD Digital Output Line Converter Interface Computer Laser Diode D Scanning to 2D Bitmap File 28 How to scan the image 29 SPI • Sampling per inch • จำนวนจุดในกำร Scan ต่อหน่วยนิว้ ควำมยำวและ หน่วยนิว้ ควำมกว ้ำง 8.5 นิว้ • หำกตัง้ ควำมละเอียดในกำร Scan เป็ น 100 SPI จะได ้ ไฟล์ขนำด 850 x 1100 Pixel • หำกตัง้ ควำมละเอียดในกำร Scan เป็ น 200 SPI 11 นิ ว ้ จะได ้ ไฟล์ขนำด 1700 x 2200 Pixel 30 How to scan the image • Resolution of sampling 31 How to scan the image • Resolution of sampling 32 How to scan the image • Bit depth 33 Image Printing DPI • Dot per Inch • จำนวนจุดในกำรพิมพ์ตอ ่ หน่วยนิว้ ควำมยำวและ หน่วยนิว้ ควำมกว ้ำง 8.5 นิว้ • หำก ไฟล์มข ี นำด 850x1100 Pixel ควำม ละเอียดในกำรพิมพ์ คือ 100 DPI 11 Pixel นิว้ • หำก ไฟล์มข ี นำด 1700 x 2200 ควำม ละเอียดในกำรพิมพ์ คือ 200 DPI 35 Color Image Printing • Color printing system 36 Printing Method Bitmap Printing Command Scrip and Processor in pri Download font to pri and send Character c to printer 37 Image File Color System of Image Files • True color system file – Like true color display system – Can compute and editing – File type : JPG, BMP(24), TIFF(24) • Index color system file – Like index color display system – Can mask the transparent color – Must generate color pattern of image in header of file – File type : GIF, BMP(8), TIFF(8) 39 Type of Image by Purpose • Display in electronic media – DPI is 72,96 dpi - Use RGB color model – Unit measure is Pixels - BMP, GIF, PCX, JPG – Not keep printing resolution information • Display in paper – – – – – DPI depend on printer (300,600,1200,1440) Use CMYK color model Unit measured in centimeter , inches Keep printing resolution information TIFF 40 Type of Image by Purpose • Example of file option to display in electronic media 41 Type of Image by Purpose • Example of file option to display in paper (for printing) 42 Type of Image Compression • Lossless วิธก ี ำรบีบอัดไฟล์ให ้มีขนำดเล็กลงและ ี รำยละเอียด เมือ ่ เรียกคืนกลับมำแล ้วไม่สญ ู เสย ของภำพ LZW Lempel-Ziv-Welch • Lossy วิธก ี ำรบีบอัดไฟล์ให ้มีขนำดเล็กลงและ ี รำยละเอียด เมือ ่ เรียกคืนกลับมำแล ้วมีกำรสูญเสย ้ นผู ้เลือก ของภำพไปบำงสว่ น โดยอยูท ่ ผ ี่ ู ้ใชเป็ ี JPEG ระดับกำรสูญเสย 43 Graphic Interchange Format • .gif • GIF87a – indexed color system, LZW, Interlacing • GIF89a – เพิม ่ Animation, Transparency 2 level • มีกำร Compression ในแนวนอน ี ้อย ภำพลำยเสน้ • ใชกั้ บภำพทีม ่ จ ี ำนวนสน • ต ้องคำนึงถึง Palette ของระบบปลำยทำงทีใ่ ช ้ 44 Palette ในระบบส ี Indexed ี ไี่ ด ้จำกภำพนั น • Adaptive Palette เป็ นตำรำงสท ้ ี ำตรำฐำนของ • System Palette เป็ นตำรำงสม ระบบปฏิบต ั ก ิ ำรต่ำงๆ – Windows system palette – Macintosh system palette – Unix system palette ี ต • Web Palette เป็ นตำรำงสท ี่ รงกันระหว่ำงหลำย ระบบปฏิบต ั ก ิ ำร มีจำนวน 216 มี ได ้มำจำก 6x6x6 ของ RGB 45 ค่ำ Gamma ั พันธ์ • ค่ำควำมสว่ำงของสำรฉำบหน ้ำจอ โดยสม กับแรงดันทีป ่ ้ อนกับจอภำพ • แต่ละระบบปฏิบต ั ก ิ ำรมีกำรชดเชยควำมสว่ำงไม่ เท่ำกัน – Macinthosh – Windows – Unix 1.8 2.2 2.3-2.5 • ค่ำมำก ภำพทีไ่ ด ้จะมีควำมมืดกว่ำค่ำน ้อย 46 JPEG • • • • • • Joint Photographic Experts Group .jpg .jpeg ใชวิ้ ธก ี ำรบีบอัดแบบ JFIF (JPEG File Interchange Format) ้ ้กับทุกระบบปฏิบต สำมำรถใชได ั ก ิ ำร ี ริง True Color 24 bit เป็ นระบบสจ เมือ ่ นำไปแสดงผลแบบ 8 bit จะสร ้ำงสใี หม่ dithering • เป็ น Lossy Compression • เหมำะสำหรับภำพเหมือนจริง หรือภำพจำนวนส ี มำก ๆ 47 PNG • • • • • • • • Portable Network Graphic .png 8 bit indexed color, 16 ,24 bit true color Lossless Compression ทัง้ แนวตัง้ และแนวนอน (Deflate) เล็กกว่ำ GIF Gamma Correction Transparency 256 Level ้ สำมำรถใชกั้ บภำพเหมือนจริง หรือภำพลำยเสนก็ ได ้ โปรแกรมสนับสนุนยังน ้อยอยู่ 48