Post on 07-Apr-2018
8/6/2019 04 Bitmapped Images
1/113
1
Bitmapped Images
Created : Rawesak Tanawongsuwan
itrtw@mahidol.ac.th
Modified : Damras Wongsawang
itdws@mahidol.ac.th
8/6/2019 04 Bitmapped Images
2/113
22
Bitmapped Images
Also known as raster graphics
Record a value for every pixelin the
image Often created from an external source
Scanner, digital camera,
Painting programs allow direct creationof images with analogues of naturalmedia, brushes,
8/6/2019 04 Bitmapped Images
3/113
33
Resolution
A measure of how finely a device
approximates continuous images using
finite pixels (density ofdots or pixels)
755
299
8/6/2019 04 Bitmapped Images
4/113
44
Device Resolution
Printers, scanners: specify as dots per unitlength, often dots per inch (dpi)
Desktop printer 600 dpi, typesetter 1270 dpi,
scanner 3003600 dpi, Video, monitors: specify aspixeldimensions
(pixel per inch - ppi)
PAL TV 768x576 px,
NTSC TV 640x480 px,
17" CRT monitor 1024x768 px,
dpidepends on physical size of screen
8/6/2019 04 Bitmapped Images
5/113
55Image Resolution
Array of pixels haspixel
dimensions, but nophysicaldimensions
By default, displayed size depends onresolution (dpi) of output device
physicaldimension = pixeldimension
Can store image resolution (ppi) in image fileto maintain image's original size
Scale by displaying device resolution
originaldevice resolution
image resolution
8/6/2019 04 Bitmapped Images
6/113
66
Resolution Calculation
128-pixel line displayed
at 72 dpi 45 mm
at 115 dpi
28 mm
at 600 dpi 5 mm
6 x 4 inches imagescanned at 600 dpi
3600 x 2400 pixels
Displayed at 72 dpi 50 x 33.3
To make it appear
at 6 x 4 inches must be scaled by72/600 = 0.12
8/6/2019 04 Bitmapped Images
7/113
77
8/6/2019 04 Bitmapped Images
8/113
88
8/6/2019 04 Bitmapped Images
9/113
99
Changing Resolution
Changing Resolution can be done by
resampling
Reducing the pixel dimensions is calleddownsampling; increasing them is
called upsampling.
Both can lead to a loss of quality.
8/6/2019 04 Bitmapped Images
10/113
1010
Image Scaling
Scaling can be done either by applying a
transformation to each original pixel or
by applying the inverse transformationto each pixel in the scaled image.
Interpolation is needed because of the
finite size of pixels.
8/6/2019 04 Bitmapped Images
11/113
1111
Trouble in scaling-up
8/6/2019 04 Bitmapped Images
12/113
1212
Forward mapping: x = s*x, y = s*y
Reverse mapping : x = x/s, y = y/s
8/6/2019 04 Bitmapped Images
13/113
1313Interpolation
Nearest neighbour Use value of pixel whose centre is closest in the original
image to real coordinates of ideal interpolated pixel
Bilinear interpolation
Use value of all four adjacent pixels, weighted by
intersection with target pixel
Bicubic interpolation
Use values of all 16 adjacent pixels, weighted usingcubic splines
Nearest-neighbour interpolation is quickest but produces
poor-quality results; bicubic is slowest but produces very
good results; bilinear is in between.
8/6/2019 04 Bitmapped Images
14/113
1414
8/6/2019 04 Bitmapped Images
15/113
1515
8/6/2019 04 Bitmapped Images
16/113
1616
Nearest Neighbor
bilinear
bicubic
8/6/2019 04 Bitmapped Images
17/113
8/6/2019 04 Bitmapped Images
18/113
1818
Image files may be too big for networktransmission, even at low resolutions
Use more sophisticated data representation
or discard information to reduce data size Effectiveness of compression will depend on
actual image data
For any compression scheme, there willalways be some data for which'compressed' version is actually bigger thanthe original
Compression
8/6/2019 04 Bitmapped Images
19/113
1919
Always possible to decompress compresseddata and obtain an exact copyof theoriginal uncompressed data
Data is just more efficiently arranged, none isdiscarded
Run-length encoding (RLE)
Huffman coding Dictionary-basedschemes LZ77,LZ78,LZW
(LZW used in GIF, licence fee charged)
Lossless Compression
8/6/2019 04 Bitmapped Images
20/113
2020
Run-length encoding (RLE)
RLE is an easy compression algorithm tounderstand
It replaces sequences of the same data values
within a file by a count number and a single value. Suppose the following string of data (17 bytes) has
to be compressed:
ABBBBBBBBBCDEEEEF
Using RLE compression, the compressed file takes
up 10 bytes and could look like this:
A*8BCD *4EF
8/6/2019 04 Bitmapped Images
21/113
2121
RLE
8/6/2019 04 Bitmapped Images
22/113
2222
Huffman code
Another use of binary trees
Binary trees are not only for searching alone
(binary search trees) Speedup the sending process over the Internet
or other communication medium
Efficient in compressing text or program files
Images are sometimes better handled by other
compression algorithms
8/6/2019 04 Bitmapped Images
23/113
2323
Character codes
ASCII code
Characters are represented by 8 bits (1 byte)
There are 256 possible valuesEvery character requires the same number of
bits (8 bits)
Example: A 65 01000000
B 66 01000001
C 67 01000010
8/6/2019 04 Bitmapped Images
24/113
2424
Compressing text
If using the same number of bitsfor each character, then thenumber of bits required torepresent N-character texts are
constant Goal: Try to reduce the number
of bits used to represent text toreduce the amount of data
A method: represent the mostused characters with the fewestbits as possible
SUSIE SAYS IT IS EASY
Character frequency
A 2
E 2
I 3
S 6
T 1
U 1
Y 2
Space 4
Linefeed 1
8/6/2019 04 Bitmapped Images
25/113
2525
Create the Huffman code
Make a Node object for each characterused in the message
Make a tree object for each of thesenodes
The node becomes the root of the tree
Insert these trees in a priority queue.
(order by frequency)
LF
1
U
1
T
1
Y
2
E
2
A
2
I
3
SP
4
S
6
8/6/2019 04 Bitmapped Images
26/113
2626
Remove two trees from the priorityqueue and make them into children of anew node
The new node has a frequency which is
the sum of the childrens frequencies
Create the Huffman code
LF
1
U
1
T
1
Y
2
E
2
A
2
I
3
SP
4
S
6
LF
1
U
1
T
1
Y
2
E
2
A
2
I
3
SP
4
S
62
8/6/2019 04 Bitmapped Images
27/113
2727
Create the Huffman code
Insert this new tree back into the priority queue Keep repeating the steps above until there is only
one tree left in the queue
LF
1
U
1
T
1
Y
2
E
2
A
2
I
3
SP4
S6
2
LF
1
U
1
T
1
Y
2
E
2
A
2
I
3
SP
4
S
6
2
3
8/6/2019 04 Bitmapped Images
28/113
2828
LF
1
U
1
T
1
Y
2
E
2
A
2
I
3
SP
4
S
6
2
3 4
5 7
9 13
22
Create the Huffman code
8/6/2019 04 Bitmapped Images
29/113
2929Character frequency Code
A 2 010
E 2 1111
I 3 110
S 6 10
T 1 0110
U 1 01111
Y 2 1110
Space 4 00
Linefeed 1 01110
S U S I E Sp S A Y S
10 01111 10 110 1111 00 10 010 1110 10
8/6/2019 04 Bitmapped Images
30/113
3030
Decoding the Huffman code
10 01111 10 110 1111 00 10 010 1110 10
S U S I E Sp S A Y S
LF U
T Y E
A I
SP S
0
1
0
8/6/2019 04 Bitmapped Images
31/113
3131
Dictionary-based Coding
LZW uses fixed-length codewords to represent
variable-length strings of symbols/characters thatcommonly occur together, e.g., words in English
text The LZW encoder and decoder build up the same
dictionary dynamically while receiving the data
LZW places longer and longer repeated entries intoa dictionary, and then emits the codefor anelement, rather than the string itself, if theelement has already been placed in the dictionary
8/6/2019 04 Bitmapped Images
32/113
3232ALGORITHM LZW Compression
8/6/2019 04 Bitmapped Images
33/113
3333LZW compression for string
ABABBABCABABBA Lets start with a very simple
dictionary (also referred toas a string table), initiallycontaining only 3 characters,with codes as follows:
Now if the input string isABABBABCABABBA, theLZW compression algorithmworks as follows:
The output codes are 1 2 4 52 3 4 6 1. Instead of sending14 characters, only 9 codesneed to be sent(compression ratio = 14/9 =1.56)
8/6/2019 04 Bitmapped Images
34/113
3434LZW Decompression (simple version)
Input codes to the decoder are 1 2 4 52 3 4 6 1
LZW decompression output stringABABBABCABABBA
The initial string table is identical to what is
used by the encoder.
8/6/2019 04 Bitmapped Images
35/113
3535LZW Decompression (simple version)
Apparently, the output
string isABABBABCABABBA, a
truly lossless result
8/6/2019 04 Bitmapped Images
36/113
3636JPEG (Join Photographic Experts Group)
A photo of a flower compressed with successively higher
compression ratios from left to right.
http://en.wikipedia.org/wiki/Jpeg
Materials on the JPEG topic are obtainedfrom
fundamentals ofMultimedia byZe-Nian Li andMark
S. Drew
http://en.wikipedia.org/wiki/Jpeg
Digital multimedia text book
8/6/2019 04 Bitmapped Images
37/113
3737
Lossytechnique, well suited to photographs,images with fine detail and continuous tones
Consider image as a spatially varying signal
that can be analyzed in the frequency domain Experimental fact:people do not perceive the
effect ofhigh frequencies in images veryaccurately
Hence, high frequency information can bediscarded withoutperceptible loss of quality
JPEG Compression
8/6/2019 04 Bitmapped Images
38/113
3838
Overview ofJPEG
compression algorithm
http://
stargate.ecn
.purdue
.edu
/~ips
/tutorials
/jpeg
/jpegtut
1.html
8/6/2019 04 Bitmapped Images
39/113
3939
JPEG encoding process
Transform RGB to YIQ orYUV and subsample
color
DCT on image blocks
Quantization
Zig-zag ordering andrun-length encoding
Entropy coding
8/6/2019 04 Bitmapped Images
40/113
4040
Color Space Transformation
The image is converted from RGB into a
different color space called YUV
The Y component represents the brightnessof a pixel, and the Uand V components
together represent the hue and saturation
This part is useful because the human eyecan see more detail in the Y component
than in the others
8/6/2019 04 Bitmapped Images
41/113
4141
Similar to Fourier Transform, analyses a signalinto its frequency components
Takes array of pixel values, produces an arrayof coefficients of frequency components in
the image Computationally expensive process time
proportional to square of number of pixels
Apply to 8x8 blocks of pixels
Using blocks, however, has the effect of isolatingeach block from its neighboring context. This iswhy JPEG images look choppy blocky when ahigh compression ratio is specifiedby the user
Discrete Cosine Transform (DCT)
8/6/2019 04 Bitmapped Images
42/113
4242
Definition ofDCT
Given aninput functionf(i; j) overtwointegervariablesiandj(a pieceof animage), the2D DCT
transformsitinto a new functionF(u; v), withintegeru
andvrunningoverthesamerange asiandj. The
general definitionofthetransformis:
wherei;u = 0;1; : : : ; M 1; j;v = 0;1; : : : ; N 1; andtheconstantsC(u) andC(v) aredetermined by
!
!
!1
0
1
0
),(2
)12(cos
2
)12(cos
)()(2),(
M
i
N
j
jifN
vj
M
ui
MN
vCuCvuF
TT
!!
otherwise1
0if2
2)(
\\C
8/6/2019 04 Bitmapped Images
43/113
43
2DDCT & IDCT
! !
!7
0
7
0
),(16
)12(cos
16
)12(cos
4
)()(),(
i j
jifvjuivCuC
vuFTT
! !
!7
0
7
0
),(16)12(cos
16)12(cos
4)()(),(~
u v
vuFvjuivCuCjif TT
8/6/2019 04 Bitmapped Images
44/113
4444
DCT (example)
If one such 8x8 8-bit subimage is:
and then taking the DCT results in
8/6/2019 04 Bitmapped Images
45/113
45
Quantization
The human eye is fairly good at seeing small differencesin brightness over a relatively large area
but notso good at distinguishing the exact strength of a
high frequencybrightness variation
So we can get away with greatly reducing the amount of
information in the high frequency components.
Divide each component in the frequency domain by a
constantfor that component, and then round to thenearest integer
This is the main lossyoperation in the whole process.
!
),(
),(),(
vuQ
vuroundvu
8/6/2019 04 Bitmapped Images
46/113
4646
Applying DCT does not reduce data size
Array of coefficients is same size as array of pixels
Allows information about high frequency
components to be identified and discarded
Use fewer bits (distinguish fewer different values)
for higher frequency components
Number of levels for each frequency coefficient
may be specified separately in a quantization
matrix
JPEG Quantization
8/6/2019 04 Bitmapped Images
47/113
4747Quantization
The entries of Q(u,v) tend to
have larger values towards
the lower right corner. This
aims to introduce more loss at
the higher spatial frequencies The tables below show the
default Q(u,v) values obtained
from psychophysical studies
with the goal of maximizing
the compression ratio while
minimizing perceptual losses
in JPEG images.
!
),(
),(),(
~
vu
vuFroundvuF
New result after quantization
8/6/2019 04 Bitmapped Images
48/113
4848
Example detail (1)
DCT Q
8/6/2019 04 Bitmapped Images
49/113
4949
Example detail (1)
DQ
IDCT
Q
Diff
8/6/2019 04 Bitmapped Images
50/113
5050Example detail (2)
8/6/2019 04 Bitmapped Images
51/113
5151
Example detail (2)
8/6/2019 04 Bitmapped Images
52/113
5252
After quantization, there will be many zerocoefficients
Use RLEonzig-zag sequence (maximizes runs)
Use Huffman coding of other coefficients (bestuse of available bits)
JPEG Encoding
8/6/2019 04 Bitmapped Images
53/113
5353
Expand runs of zeros and decompressHuffman-encoded coefficients to reconstruct array offrequency coefficients
Use Inverse Discrete Cosine Transform (I
DCT) totake data back from frequency to spatial
domain
Data discarded in quantization step ofcompression procedure cannot be recovered
Reconstructed image is an approximation(usually very good) to the original image
JPEG Decompression
8/6/2019 04 Bitmapped Images
54/113
5454Decoding process
Multiply by
quantization matrix
Apply IDCT
8/6/2019 04 Bitmapped Images
55/113
5555
If use low quality setting (i.e. coarserquantization), boundaries between 8x8blocks become visible
If image has sharp edges, these becomeblurred
Rarely a problem with photographic images,
but especially bad with text Better to use good lossless method with text
or computer-generated images
Compression Artifacts
5656
8/6/2019 04 Bitmapped Images
56/113
5656
Example
5757
8/6/2019 04 Bitmapped Images
57/113
5757JPEG2000
JPEG2000 improves on JPEG in many areas,including image quality at highcompression ratios. It can be usedlosslesslyas well as lossily.
For JPEG2000 compression the image isdivided into tiles, but these can be anysize, up to the entire image.
Take advantage of a Discrete WaveletTransform (DWT)
Encode by using ArithmeticCoding
5858
8/6/2019 04 Bitmapped Images
58/113
5858
5959
8/6/2019 04 Bitmapped Images
59/113
5959
File Formats
GIF(Graphics Interchange Format)
GIF files use LZW compression (lossless)
Restricted to 256 colours (indexed colour) One colour may be used to designate
transparency.
They are most suitable for simple imageswith areas of flat colour (cartoon-style
drawing, animation)
6060
8/6/2019 04 Bitmapped Images
60/113
6060
6161
8/6/2019 04 Bitmapped Images
61/113
6161
PNG (Portable Network Graphics)
PNG was developed to supersede GIFbecause at that time LZW requiredlicence fee
It uses deflate compression (LZ77 +Hoffman Coding, lossless)
Not restricted to 256 colours
Supports alpha channels for partialtransparency and special effects
6262
8/6/2019 04 Bitmapped Images
62/113
6262
JPEG Format
JPEG data can be stored in several differentformats.
JFIFand SPIFFare compatible formats for
JPEG images and are widely used on theWeb.
Exifcan hold either JPEG or TIFF data,
together with extensive metadata. JP2 andJPXformats are defined for storingJPEG2000 data.
6363
8/6/2019 04 Bitmapped Images
63/113
6363
TIFF(Tag Image File Format)
TIFF is an extensible format
Store full-colour bitmaps
Uses several different compressions,LZW+JPEG, or may be no compression
Often used for storing uncompressed
digital photographs, and for interchangeof images.
6464
8/6/2019 04 Bitmapped Images
64/113
6464
BMP (MS Windows Bitmap)
BMP is a simple bitmapped image
format that is native to Windows, but
widely supported. BMP files are often uncompressed
Platform-dependent
6565
8/6/2019 04 Bitmapped Images
65/113
6565
PDF(Portable Document Format)
PDFdocuments can include bitmapped
image data, that may be compressed
usingJ
PEG,J
PEG2000, LZW, deflate, andothers.
6666
8/6/2019 04 Bitmapped Images
66/113
6666
Raw Formats
Camera raw data is used when complete
control over image processing is required
There is no standardformat for camera raw
data.
Adobes DNG (Digital Negative) format is a
standard, based on the TIFF format,
intended for archiving camera raw images.
6767
8/6/2019 04 Bitmapped Images
67/113
6767
A Raw File
A record of the data captured by the
camera sensor
Unprocessed sensor data
6868
8/6/2019 04 Bitmapped Images
68/113
6868
Raw Image Files
File extension:.raf(Fuji)
.crw, .cr2 (Canon)
.kdc, .dcr(Kodak)
.mrw(Minolta)
.nef(Nikon)
.orf(Olympus)
.dng(Adobe)
.ptx, .pef(Pentax)
.arw, .srf(Sony)
.x3f(Sigma)
.erf(Epson)
6969
8/6/2019 04 Bitmapped Images
69/113
6969
Digital Camera
Most digital cameras sample an imagewith red, green and blue sensors
arranged in a photoreceptor array
7070
8/6/2019 04 Bitmapped Images
70/113
7070
Digital Camera
The purpose of the microlens arrayis to
focus the light onto each pixel
The color filter array changes the colorresponsivity of each pixel
Finally, the sensor array captures the
light and generates the electrical signal
7171
8/6/2019 04 Bitmapped Images
71/113
7171Mosaic Sensor / Color Filter Array (CFA) Camera
A 2D array to collect the photons that are recorded in
the image
Made up of rows and columns of photosensitive
detectors (CCD or CMOS) to form an image
Each element of the array contributes on pixel to thefinal image
7272
8/6/2019 04 Bitmapped Images
72/113
7272
Color Filter Array (CFA)
The sensors count photons, produce acharge thats directly proportional to theamount of light that strikes them
The raw files from color filter array camerasare grayscale
Grayscale to Color
Each element in the array is covered by acolor filter, so that each element capturesonly red, green, or blue light
7373
8/6/2019 04 Bitmapped Images
73/113
7373
A Bayer filter pattern
A mosaic of red, blue and green filters in alternatingrows ofRG and GB
Twice as many green filters are used as redor blue
because our eyes are most sensitive to green light
7474
8/6/2019 04 Bitmapped Images
74/113
7474
Filter patterns
RGB or CMY or 4-color-mix are possible
Each element in the sensor capturesonly one color
The red-filtered elements produce agrayscale value proportional to theamount of red light reaching the sensor
Same as the green-filtered and bluefiltered elements
7575
8/6/2019 04 Bitmapped Images
75/113
7575
Info. in the raw files
The image pixels themselves
The image metadata (data about data)
Records shooting data such as the cameramodel, serial number, shutter speed,
aperture, focal length, flash
Additional information that might beneeded to convert into an RGB image
7676
8/6/2019 04 Bitmapped Images
76/113
7676
Raw Converter
7777
8/6/2019 04 Bitmapped Images
77/113
7777
Demosaicing
To display the image, we must create an
image that has a red, green and blue
pixel at each location Interpolate the missing sensor values
7878
8/6/2019 04 Bitmapped Images
78/113
7878
Demosaicing Illustration
This is the original image, made with AdobeIllustrator
7979
8/6/2019 04 Bitmapped Images
79/113
7979
Demosaicing Illustration
A simulated sampling taken by a Bayer filteredsensor array
Each pixel only has a value of either R or G or B
8080
8/6/2019 04 Bitmapped Images
80/113
8080
Demosaicing Illustration
A zoom-in version
8181
8/6/2019 04 Bitmapped Images
81/113
8181
Demosaicing Illustration
An example reconstruction
8282
8/6/2019 04 Bitmapped Images
82/113
88
Demosaicing Illustration
A zoom-in version
original reconstruct
8383D i i Al ith
8/6/2019 04 Bitmapped Images
83/113
Demosaicing Algorithms
Nearest Neighbor Replication
simply copies an adjacent pixel of the correct color component
Simple interpolation
Bilinear, Bicubic, Spline, Laplacian interpolation
Synthetic field based interpolation Compute an alternate representation
Hue interpolation, Log hue interpolation
Adaptive
Adapt their methods of estimation depending on features of the
area surrounding the pixel of interest
Proprietary
Commercial products
8484
8/6/2019 04 Bitmapped Images
84/113
Raw Conversion
In addition to demosaicingWhite balance
Colorimetric interpretation assigns the correct,
specific color meanings to the red, green, andblue pixels, usually in a colorimetrically definedcolor space such as CIE XYZ, which is baseddirectly on human color perception
Gamma correction is done to redistribute thetonal information so that it corresponds moreclosely to the way our eyes see light and shade
Noise reduction, anti-aliasing, and sharpening
8585Benefits
8/6/2019 04 Bitmapped Images
85/113
Benefits Finer control is easier for the settings
For example, the white point can be set to any value,not just discrete values like "daylight" or"incandescent"
The settings can be previewed and tweaked toobtain the best quality image or desired effect
Camera raw files have 12 or 14 bits of brightnessinformation
JPEG loses fine details and is ill-suited for majorcolor or brightness changes
The working color space can be set to whatever isdesired
Different demosaicing algorithms can be used, notjust the one coded into the camera
8686Drawbacks
8/6/2019 04 Bitmapped Images
86/113
Drawbacks Camera raw files are typically 2-6 times larger than
JPEG Fewer images can fit on a given memory card
It also takes longer for the camera to write rawimages to the card
fewer pictures can be taken in quick succession (a sportssequence)
No single widely-accepted standard raw format Adobe's DNG format has been put forward as a standard,
but is not adopted by major camera companies Specific software may be required to open raw files
on some systems, as opposed to JPEG or TIFF
Time taken in the image workflow
8787Software Supports
8/6/2019 04 Bitmapped Images
87/113
Software Supports Dcraw
Adobe Photoshop / Adobe Photoshop Lightroom Microsoft's Digital Image
Mac OS X
added raw support directly to the system
which adds raw support automatically to the majority of MacOS X applications (such as Preview, Mac OS X's PDF and imageviewing application)
Helicon Filter
Bibble Pro
Picasa a free image editing and cataloging program from Google, but
only limited tools for RAW processing
UFRaw is free software based on dcraw
8888
8/6/2019 04 Bitmapped Images
88/113
References
Adobe.com
Wikipedia.org
http://www.imageval.com/public/Products/ISET/ISET_Manual/Demosaicing.htm
http://photo.net/learn/raw/
http://www.cambridgeincolour.com/tutorials/RAW-file-format.htm
8989
8/6/2019 04 Bitmapped Images
89/113
Image Manipulation
Image manipulation software provides highlevel operations for systematically alteringpixels
Most operations are described by analogy withtraditional photographic techniques, such asthe use ofmasks andfilters.
Bitmapped images are manipulated to correcttechnicaldeficiencies, alter the content(retouch) or create artificial compositions.
9090
8/6/2019 04 Bitmapped Images
90/113
Image Editing Software
Photoshop is the de facto industry
standard;
The Gimp is an Open Source alternative. Image Magickcan be used for
command-line processing.
9191
8/6/2019 04 Bitmapped Images
91/113
Compositing
The process ofassembling multipleimages to make a final image.
Images are often organized into layers,which are like overlaid sheets that mayhave transparent areas.
Layers are used for compositing or
experimenting with different versions ofan image.
9292
8/6/2019 04 Bitmapped Images
92/113
9393
8/6/2019 04 Bitmapped Images
93/113
Selection
Areas may be selected by drawing with
marquee : geometrical shape
lasso tools or Bzier pen : free hand
magic wand: selected on the basis of colour
similarity
magnetic lasso : selected on the basis of edges
9494
8/6/2019 04 Bitmapped Images
94/113
(Selection based on color)
9595
8/6/2019 04 Bitmapped Images
95/113
(Selection based on edge detection)
9696
8/6/2019 04 Bitmapped Images
96/113
Mask & Alpha Channel
Any selection defines a mask the area that
is not selected. Masked areas of the image
are protected from changes (all or nothing).
A greyscale mask, which is partially
transparent, is an alpha channel.
An alpha channelcan be associated with a
layer as a layer mask, and used for effects
such as knock-outs and vignettes.
9797
8/6/2019 04 Bitmapped Images
97/113
(Knock-out)
9898
8/6/2019 04 Bitmapped Images
98/113
p = Ep1
+(1-E)p2
9999
8/6/2019 04 Bitmapped Images
99/113
Pixel Point Processing
In pixel point processing, each pixels
new value depends only on its oldvalue
Brightness, contrastand levels are
relatively crude pixel point adjustments.
p = f(p)
100100Brightness (increase B&W)
8/6/2019 04 Bitmapped Images
100/113
(Original image)
(increase difference between B&W)
101101
8/6/2019 04 Bitmapped Images
101/113
102102
8/6/2019 04 Bitmapped Images
102/113
Levels adjustment(Adjust B&W independently)
103103
dj
8/6/2019 04 Bitmapped Images
103/113
Curve Adjustments
Curves adjustments provide full control
over the relationship between original
and new values.
A sigmoidcurve is often used to
enhance contrast.
104104
8/6/2019 04 Bitmapped Images
104/113
fixed
Increase white
Increase black
105105
8/6/2019 04 Bitmapped Images
105/113
106106
Pi l G P i
8/6/2019 04 Bitmapped Images
106/113
Pixel Group Processing
Pixel group processing uses the valuesof neighbouring pixels as well.
The convolution operation in the
frequency domain can be implementedas a weighted average in the spatialdomain: for each pixel in the filtered
image, the pixels of a convolution kernelare combined using a convolution mask.
107107
8/6/2019 04 Bitmapped Images
107/113
108108
G i Filt
8/6/2019 04 Bitmapped Images
108/113
Gaussian Filter
Simple blurring uses a 3 x 3 mask with
equal values but produces crude results.
Gaussian blur is preferred, as itproduces more natural results.
109109
8/6/2019 04 Bitmapped Images
109/113
110110
Sh i
8/6/2019 04 Bitmapped Images
110/113
Sharpening
Sharpening with a 3x3 mask is crude.
Unsharp masking combining an image
with a Gaussian blurred copy of itself produces better-looking results.
Over-sharpening should always be
avoided.
111111
8/6/2019 04 Bitmapped Images
111/113
112112
8/6/2019 04 Bitmapped Images
112/113
113113
I Editi d M i l ti
8/6/2019 04 Bitmapped Images
113/113
Image Editing and Manipulation
Image Inpainting / Image Completion
Texture Synthesis
Shape manipulation .
.
.