370 likes | 469 Views
G0Q55A Multimedia: modelleren en programmeren. Martin Wolpers & Erik Duval 09 November 2007. Today. Group presentation groups Some secrets of images Java & Java Media Framework Java Assignment. Group presentations. Group 5 Jan Sebrechts Sébastien Devynck Pieter Gevers
E N D
G0Q55A Multimedia: modelleren en programmeren Martin Wolpers & Erik Duval 09 November 2007 G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Today • Group presentation groups • Some secrets of images • Java & Java Media Framework • Java Assignment G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Group presentations • Group 5 • Jan Sebrechts • SébastienDevynck • Pieter Gevers • Kim Gressens • IweinVranckx • Group 6 • Jelle Wardenier • Laurens Serneels • Stijn Adriaensens • Tim Boven G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Secrets of Images • Digital images vs. Analog images • Here • Digital representations of images • No video! • No recording! • No capturing! Presentation based on Fundamentals of Multimedia, Li&Drew, Prentice Hall 2003 G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Outline • Color models (RGB vs. CYM) • Gray Images • 1-bit • Gray scale • Color images (GIF) • Color images compression (JPG) G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Color models • RGB: Red – Green – Blue • For monitors: colors add • CMY: Cyan – Magenta – Yellow • For printing: colors subtract G0Q55A – Multimedia: modelleren en programmeren 2007/2008
RGB vs. CMY G0Q55A – Multimedia: modelleren en programmeren 2007/2008
RGB <->CMY Transformation C 1 R M = 1 - G Y 1 B R 1 C G = 1 - M B 1 Y G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Gamma Correction • Color ~ (Voltage of color electron gun)gamma => not enough light with low voltages G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Monochrom image • 1-bit: white or black • 640x480~37,5 kByte • Pixel?? G0Q55A – Multimedia: modelleren en programmeren 2007/2008
8-bit gray-level images G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Bitmap raster Graphic from www.wikipedia.org G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Bitmap • 1 pixel = 1 gray value • 1 gray value = 1 byte • Bitmap = cube with dimension image size x 8 bit • Size 640x480x1Byte= 300kByte • E.g. bmp G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Dithering • Transform 1 pixel to larger pattern • Used for 1-bit printers • Example • 2x2 dither matrix: transform [0..255] -> [0..4] • 0:0 1: [1..63], 2:[64..127], 3:[128..191], 4:[192..255] • Better ideas? • Size: 4x640x480x1Byte G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Color Images • 24-bit color images • 3 channels, 1 Byte per channel • 256x256x256 colors (~16M) (more later) • Size: 640x480x24bit ~ 900kByte • 32-bit color images • 24-bit images + special effects channel (1 Byte) • 8-bit color images • No direct color information • Color look-up index G0Q55A – Multimedia: modelleren en programmeren 2007/2008
8-bit color images 900kByte 300kByte G0Q55A – Multimedia: modelleren en programmeren 2007/2008
8-bit images • 1byte index into color palette (256 colors) • Size: 1bytex640x480 ~ 300kByte G0Q55A – Multimedia: modelleren en programmeren 2007/2008
File Formats Bitmaps and Container • TIFF • WMF • 8-bit GIF • PNG • JPEG • EXIF Vector formats • PS and PDF • SVG G0Q55A – Multimedia: modelleren en programmeren 2007/2008
TIFF • TIFF: stands for Tagged Image File Format. • Attachment of additional information (referred to as “tags”) Flexibility • Most important tagformat signifier: type of compression etc. • TIFF can store many different types of image1-bit, grayscale, 8-bit color, 24-bit RGB, etc. • TIFF is lossless format but JPEG compression possible G0Q55A – Multimedia: modelleren en programmeren 2007/2008
WMF • Microsoft Windows: WMFnative vector file format: • Consist of a collection of GDI (Graphics Device Interface) function calls, also native to the Window environment. • “played” a file (typically using the Windows PlayMetaFile() function) == render graphics • Device-independent and unlimited in size. G0Q55A – Multimedia: modelleren en programmeren 2007/2008
GIF • Graphics Interchange Format • GIF87a (original) • GIF89a (extension for simple animations) • 8-bit color images • Interlacing G0Q55A – Multimedia: modelleren en programmeren 2007/2008
GIF87 file format GIF Signatur Screen Descriptor Global Color Map Image Descriptor Local Color Map Repeat n times Raster Area GIF Terminator G0Q55A – Multimedia: modelleren en programmeren 2007/2008
GIF87 Screen Descriptor G0Q55A – Multimedia: modelleren en programmeren 2007/2008
GIF87 Color Map Length: 2^(Pixel+1) G0Q55A – Multimedia: modelleren en programmeren 2007/2008
PNG • PNG format: standing for Portable Network Graphics • → meant to supersede the GIF standard, and extends it in important ways. • Special features of PNG files include: • Support for up to 48 bits of color information — a large increase. • contain gamma-correction and alpha-channel information • Progressive display (2-dimensional fashion in seven passes through each 8 × 8 block) G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Compression • JPEG • Image compression standard (Joint Photographic Experts Group) 1992 • JPEG is a lossy image compression method • transform coding method using the DCT (Discrete Cosine Transform). • An image = F(i, j) in the spatial domain. • 2D DCT yields a frequency response which is a function F(u, v) in the spatial frequency domain G0Q55A – Multimedia: modelleren en programmeren 2007/2008
JPEG Basics (Redundancy) • Observation 1 • Intensity does not change widely in small areas • Observation 2 • High spatial frequency less noticed by humans • Observation 3 • Visual acuity (accuracy in distinguishing closely spaced lines) is much greater for gray (“black and white”) than for color. G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Technology behind JPEG G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Examples of JPG quality Original 20% 5% G0Q55A – Multimedia: modelleren en programmeren 2007/2008
EXIF • EXIF (Exchange Image File) used for digital cameras: • Compressed EXIF files use the baseline JPEG format. • Tags (many more than in TIFF) facilitate higher quality printing, more information • about the camera • picture-taking conditions (flash, exposure, light source, white balance, type of scene, etc.) • Specification of file format for audio that accompanies digital images. G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Vector images • Images made up of simple mathematically describable geometrical forms • E.g. lines, polygons, circles, bezier curves, etc. • Combined and transformed to form complex objects • File formats • PS and PDF • SVG: xml based, WWW consortium • WMF: windows • Text, too: True Type fonts G0Q55A – Multimedia: modelleren en programmeren 2007/2008
PS and PDF • Layout and Content are true-copy enabled! • Postscript – language for typesetting • Vector-based picture language • Postscript includes text as well as vector/structured graphics. • GL bit-mapped images included in output • Encapsulated Postscript (eps) files add additional information for inclusion • no compression (stored as ASCII) • Portable Document format (PDF) • LZW compression • Without images (compression ratio, 2:1 or 3:1) G0Q55A – Multimedia: modelleren en programmeren 2007/2008
SVG example Graphic from www.wikipedia.org G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Image Processing • Filtershttp://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Morpholo.html • Image processing at TU Delft http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip.html G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Java and Java Media Framework Java Tutorial • http://java.sun.com/docs/books/tutorial/ Java Media Framework • http://java.sun.com/products/java-media/jmf/ G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Assignment 3 Implementation of your CO2 calculator in Java Follow strictly (!!) • Your Storyboard • Your Flow Chart /State Diagram • Your Layout • Your Timeline Running Applet (!) including source code documentation Deadline: 21.11.2007 G0Q55A – Multimedia: modelleren en programmeren 2007/2008
Please keep in mind • Applet works; name restrictions • Programming Syle: readalbe, structured, layout, naming, ... • Document differences to flash, smil, etc. wnd why! • Say who did what for how long • Used tools G0Q55A – Multimedia: modelleren en programmeren 2007/2008