Download download

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Framebuffer wikipedia , lookup

Spatial anti-aliasing wikipedia , lookup

Portable Network Graphics wikipedia , lookup

Stereoscopy wikipedia , lookup

List of 8-bit computer hardware palettes wikipedia , lookup

Stereo display wikipedia , lookup

Dither wikipedia , lookup

Color wikipedia , lookup

Anaglyph 3D wikipedia , lookup

BSAVE (bitmap format) wikipedia , lookup

Color vision wikipedia , lookup

Image editing wikipedia , lookup

Hold-And-Modify wikipedia , lookup

Indexed color wikipedia , lookup

Transcript
Image 1
Subject
Session
Tahun
Versi
:
:
:
:
T0934 / Multimedia Programming Foundation
4
2009
1/0
Learning Outcomes
In the end of this session, students must be
able to:
– Understand the concept of color
– Recognize the type of color
model/space
– Understand the image compression
and file format
– Recognize basic Java 2D API
Bina Nusantara
Course Outlines
•
•
•
•
Color
Color Space
Digital Image
Digital Imaging in Java
Bina Nusantara
Color
• Color is a sensation,
perceived by the brain when
our eyes caught the light
reflected by an object
• Human eyes has three types of cones
which responds to three different kinds
of light’s wavelengths
Bina Nusantara
Tristimulus theory
• Therefore it’s suggested that any color can
be described using only three parameters
(tristimulus theory) which is called as three
primary colors
Three
Parameters
Bina Nusantara
Three Primary
Colors
Color Model
Color Model
•
•
•
•
RGB
CMY(K)
HSB
CIE
– CIEXYZ
– CIELUV
– CIELAB.
Bina Nusantara
Color Model - RGB
• Basic model
• Additive primary color
• Light based
• Used in electronic display such as CRT
monitor, LCD/ plasma TV
Bina Nusantara
Color Model – CMY(K)
•
•
•
•
Basic model
Subtractive primary color
Pigment based
K  to get better black
• Used in printing devices and film
Bina Nusantara
Color Model – HSB
Hue
• Color
Saturation
• Level of gray
Brightness
• Level of
illumination
• Also known as HLS (Hue-Lightness-Saturation) or HSV
(Hue-Saturation-Value)
• Used in computer graphic program
Bina Nusantara
Color Model - CIE
• RGB & CMY can’t
represent all visible colors
• Standard set by CIE
(Comission Internationale de l'Eclairage/
International Commission on Illumination)
• Based on how humans
perceive color
Bina Nusantara
Color Model - CIE
• CIEXYZ
– First CIE model
– XYZ is reformulated tristimulus value to cover all possible color
• CIELUV
– Revised CIEXYZ
• CIELAB.
– A different approach developed in 1942
Bina Nusantara
Gamut
• A range of color that can be produced by a
device or a color model
• Colour gamut of print media is (generally)
smaller than monitor RGB.
Bina Nusantara
Color Space
Color
Model
Gamut
Bina Nusantara
Color Model
Color Space
RGB
Adobe RGB
CIE RGB
sRGB
Color
Space
Color
This is an example to make a
panel that is colored by RGB
color
Bina Nusantara
Digital Image
•
•
•
•
Raster Image
Color Depth
Indexed Image
Image Compression
Bina Nusantara
Raster Image
• Raster image  matrix/array of pixel
Original image
Shown
magnified
Bina Nusantara
Color Depth
True Color (24 bits)
8 bits
Colour Depth
>16 million possible colors
4 bits
256 colors
1 bit
16 colors
Bina Nusantara
2 colors (monochrome)
http://en.wikipedia.org/wiki/Color_depth
Indexed Image
• Indexed/palette-based color is limited to
certain bit amount of color
256 color
(8bit)
Bina Nusantara
16 (4bit)
4 color (2bit)
Image Size Property
Bina Nusantara
Image Size Property
This is an example to show an image, then get the width and height of the image
Bina Nusantara
Image Compression
• Reducing the amount of bits needed to
represent an image with reasonable
quality
• Lossless compression
– Run-length coding
– Entropy coding (Huffman, Arithmethic)
– LZ variations coding (LZW, LZ77, LZ78, etc)
• Lossy compression
– Transform coding
• DCT - Discrete Cosine Transform
• DFT - Discrete Fourier Transform
• DWT – Discrete Wavelet Transform
Bina Nusantara
GIF Compression
• Graphics Interchange Format (GIF87a,
GIF89a)
• Uses the modified LZW coding
• Limited to only palette-based images
• Suitable for images with few distinctive
colours (ex : graphics drawing)
Bina Nusantara
JPEG Compression
• First general purpose image compression
standard was developed by Joint
Photographic Experts Group
• Support truecolor dan grayscale image
• Suitable for natural image
8x8 blocks
DCT
Original
Image
Bina Nusantara
Quantizer
Entropy
Encoder
Compressed
Image
JPEG variations
• Lossless JPEG
– Employs a simple differential coding method without transform
coding
• JPEG2000 Standard
– New standard for image format
– Better quality of the compresssed image
– Provides superior lossless and lossy compression
Bina Nusantara
PNG Compression
• Intended to replace patented GIF dan
complex TIFF formats
• Support truecolor, grayscale, dan palettebased image
• Suitable for cartoon image
Precompression
DEFLATE
Compression
Compressed
Image
Original Image
LZ77 + Huffman
Bina Nusantara
Digital Imaging in Java
• Digital imaging was supported by three
imaging model :
1. The AWT push model
2. The immediate mode model
3. The pull model
Bina Nusantara
Buffered Image
• Raster
• ColorModel
Bina Nusantara
Compressing Image in Java2D
We use Iterator Class to make compressing ability in Java2D.
setCompressionQuality use value between 0 and 1.
Remember to use double (with f at the end of the number).
Full code is downloadable in Additional Material
References
•
•
•
•
•
•
•
•
•
Basic Color Theory for the Desktop. 2000.
http://dba.med.sc.edu/price/irf/Adobe_tg/color/main.html
Colour Image Processing. 1997.
http://www.cse.iitk.ac.in/users/amit/courses/768/vision/robyn/colorvis/colour.
html
Indexed Color and Palettes. 2008. http://www.scantips.com/palettes.html
Multimedia Data. 2001.
http://www.cs.cf.ac.uk/Dave/Multimedia/node141.html
Programming in Java Advanced Imaging. 1999.
http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guideunc/J2D-concepts.doc.html
Color. 2009. http://en.wikipedia.org/wiki/Color
Color Model. 2009. http://en.wikipedia.org/wiki/Color_model
Digital imaging. 2009. http://en.wikipedia.org/wiki/Digital_imaging
Image Compression. 2009. http://en.wikipedia.org/wiki/Image_compression
Bina Nusantara