Data Rep. Flashcards
How do computing technologies represent numbers, text, images, video, and sound?
using just two symbols: 0’s and 1’s
- 0’s and 1’s are embodied as ‘high’ (on) or ‘low’ (off) signals on various electronic and optical storage media (ie. punch cards, vacuum tubes, transistors, DVDs)
What is a decimal number?
base 10
- every column is worth 10x as much as previous one
- each digit can be any value from 0-9
What is a binary number?
base 2
- every column is worth 2x as much as previous one
- each digit is 0 or 1
What is a bit?
short for binary digit – is 0 or 1
How do computers process binary numbers?
ie. when computer sees 1000000 (by something like one “on” part on DVD followed by six “off” parts on DVD), it reads this as binary and processes it as decimal 64
64 and 1000000 are two representations of same number
How are binary numbers read and written?
- say each digit when reading binary numbers
- may see letter ‘b’ to make it clear it is binary number
- may see subscript 2 after number to make it clear it is binary number
What is a hexadecimal number?
base 16
digits: 0-F
- compromise between humans and computers (humans have trouble with binary; computers don’t understand decimal)
- easy to convert between hex and binary
How can hexadecimal digits be represented?
digits can be represented perfectly by 16 symbols of 4-bit sequences
- 0000 = hex 0
- 0001 = hex 1
- 1111 = hex F
What is a hexit?
4 bits
Why is it easy to convert between hex and binary?
because each hex digit corresponds to 4-binary sequence
If you shift binary number to left by one bit, and pad empty space with zero, you are _____.
multiplying by 2
ie. 0b0010 → 0b0100 = 2 → 4
ie. 0b0100 → 0b1000 = 4 → 8
If you shift hex number to left by one bit, and pad empty space with zero, you are ___.
multiplying by 16
ie. 0x01 → 0x10 = 1 → 16
ie. 0x10 → 0x100 = 16 → 256
What are the advantages of ternary computers over binary computers?
- lower electricity consumption
- lower production cost
What is a ternary system?
base 3
What is the general rule for number systems?
take base (ie. how many single digits are allowed in particular number system) and raise it to power of however many spots you have
What does ‘mod’ mean?
determining the remainder
How do we store letters in hex?
ASCII (American Standard Code for Information Interchange)
128 values (7 bits, since 2^7 = 128)
Other than letters, what else is stored in ASCII?
punctuation, spaces, and other special control characters are encoded
What is a code point?
each encoded item in ASCII
Why does ASCII have 7 bits?
extra ‘check’ bit was included that could be used to detect certain errors that might arise (ie. when sending data over a modem)
What is extended ASCII?
uses all 8 bits
allows for characters with accents
What is unicode?
text representation standard
- with 1,112,064 code points, it covers most of world’s modern and historic writing systems
What are the different implementations of unicode?
includes UTF-8 and UTF-16, which are variable length encodings (use 1 byte (8 bits) for ASCII, but more for other characters)
(UTF = unicode transformation format)
Formatting
What does uploading a Word document into Hex editor do?
suggests that document is not in ASCII representation
How does Word store its data?
it’s actually a zipped collection of files
- if you unzip a word document, you can see these files
What format are Word documents in?
most files that comprise a Word document are in XML (extensible markup language) format
- they describe metadata such as font style and size, document creator, etc.
- files may also contain information about tracked changes to document, collaborators, privacy and security settings, and more
What are the privacy implications of Word?
information that’s encoded in Word document can have data that you don’t necessarily want to share
Can you get rid of metadata from Word documents?
there are ways to ‘scrub’ metadata from Word documents
- details depend on type of computer (Mac or PC) and on version of Word
How do monitors, phone screens, and TVs make different colours?
by mixing red, green, and blue lights
How many intensities do computer applications use?
256 intensities (8 bits) for each of red, green, and blue
What is the hex representation for black?
000000
absence of light
What is the hex representation for white?
FFFFFF
full intensity of each colour
What are the two ways that computers commonly store images?
-
What is a bitmap?
most common way computers store images
pictures is chopped up into pixels
What are pixels?
small little squares
How is each pixel’s colour stored?
in RGB
most displays divide each pixel into separate red, green, and blue subpixels
What kind of representation do we want for fixed resolution (ie. number of pixels)?
want a representation to specify a unique image, up to rescaling
What must a bitmap image representation specify?
- first byte indicates image width (or number of columns in grid of pixels, from 0 to 255)
- second byte indicates image height (or number of rows in grid of pixels, from 0 to 255)
- remaining data stores RGB colour specification of each pixel in a grid in a precise order (say from top left to bottom right)
What are the 2 approaches to compressing bitmap images?
lossless compression
lossy compression
What is loss less compression?
preserves all data – image looks exactly the same
What are two examples of lossless compression?
run-length encoding
indexed colour
What is run-length encoding?
collapse ‘runs’ of identical colours
- still used by fax machines
- rare in modern image formats
What is indexed colour?
build colour palette, identify each pixel with index in palette instead of full RGB colour
- used by GIF, PNG formats
What is lossy compression?
loses data
- modify areas with similar colour to use same colour – image doesn’t look exactly the same
- used by JPG format
How do we write out run-length encoding?
- width (or number of columns in grid of pixels)
- height (or number of rows in grid of pixels)
- specify each run until grid is encoded
What is a run?
RGB colour specification of pixel, followed by number of runs of that colour
ie. 5C009A 05 (5 pixels in a row with this colour specification)
What kind of compression can JPEG do?
capable of 10:1 compression, without detectable loss of clarity, by counting similar colours as ‘the same’ and keeping regions small
What is the size of a screen ‘pixel’?
depends on how display’s resolution is set
What does a lower resolution on a display screen mean for images?
lower resolution = poorer quality of images displayed (at a given scale)
What is resolution measured in?
dots per inch (dpi)
What does a higher resolution of bitmap representation mean for images?
higher resolution of bitmap representation = higher quality of image that is produced (on screen, paper, etc.) at a fixed scale
How does computer store data?
essentially as a grid
goes pixel by pixel, row by row, to store information in image
What are the pros of bitmap image and storage as a grid?
- easy to conceptualize
- translate well to dot format output devices (things that print in dots per inch – dpi) like printers and photographs
What are the cons of bitmap image and storage as a grid?
- shrinking image by throwing away pixel information causes image to blur
- storage can be large
Why are bitmaps not the best choice for all images?
if you zoom in on bitmap images, they get ‘pixelated’
What are vector images?
describe images based on points and how they’re connected
What is the basic approach to vector image representation?
describe each object of image either as:
- sequence of dots (connected by lines)
- simple shape (ie. rectangle, circle)
describe colour (fill) of each closed object
What are the extensions of the basic approach of vector image representation?
- add width and colour of lines
- use curves instead of lines
- add shading to objects
- specify which objects overlay others
How do you control line colour and thickness (relative to grid size) in vector image representation?
- use hex colour code
- introduce new convention to measure line thickness (ie. ‘pt’)
How is a pixelated look avoided with vector representation?
when we repeatedly zoom in, we run the “scale, then map” algorithm repeatedly
What is a pro of vector images?
good at storing things with hard edges
What is a con of vector images?
can be computationally costly when you want to do things like blur (ie. hazy landscapes, portraits, etc.)
Describe bitmap vs. vector graphics.
Bitmap:
- pixel-based
- doesn’t scale up well
- continuous colour tones
- multiple layers that are combined into single layer
Vector
- lines, curves, shapes
- can be scaled to any size
- colours limited by shapes (usually one colour per shape)
- multiple layers distinct from each other
- resolution independent
What are the bitmap image representation formats?
- PNG
- JPEG
- GIF
- TIFF
What is PNG?
portable network graphics – lossless compression
What is JPEG?
joint photographic experts group – lossy compression
What is GIF?
graphics interchange format; supports animation – lossless compression
What is TIFF?
tagged image file format – may be lossy compression
What are the vector image representation formats?
- SVG (scalable vector graphics)
- AI (adobe illustrator artwork)
- EPS (encapsulated postscript)
What do image files have that .docx and .txt files do?
different types have distinguishing header information, enabling applications to interpret the representation (or decline to open file)
In what ways is image metadata used?
- record keeping
- catching tax evaders
- cyberstalking
What does animate mean?
‘to give life to’
What does an animator do?
takes static image or object and literally bring it to life by giving it movement and personality
What do animators do in computer animation?
use software to draw, model and animate objects and characters in vast digital landscapes
What are the 3 types of animation?
hand-drawn animation
2D traditional animation
3D animation
How does hand-drawn animation work?
- draw each frame by hand
- photograph frames and stitch together into a video
- number of frames per second (typically 24fps right now) makes images look seamless
What is the downside of hand-drawn animation?
very length and costly
Keyframe Animation
What are the steps?
- animator draws objects and characters either by hand or with computer
- animator positions creations in key frames, which form outline of most important movements
- tweening: fill in ‘in-between’ frames by filling things in in some “cheaper” fashion
Keyframe Animation
How is tweening done in hand-drawn animation?
hand off tweening to assistant
Keyframe Animation
How is tweening done in computer animation?
use algorithm to fill in gaps
Keyframe Animation
Compare the animation of movement then vs. now.
then: draw out each frame of movement
now: draw out first and last frame (tweening will be done by computer)
What is computer-generated animation or imagery (CGI)?
3D – objects and characters are models on plane with X, Y, and Z axis
Is keyframing involved in computer-generated animation or imagery (CGI)?
keyframing and tweening are still important function of computer-generated animation, but there are other techniques that don’t relate to traditional animation
Computer-generated Animation
What is rendering?
converting 3D model to 2D bitmap image
Computer-generated Animation
Describe the process of rendering.
- 3D computer model
- camera movement sequence and timing is determined (by artists) via computer model
- sequence is used to automatically ‘render’ background of each frame
Computer-generated Animation
What do algorithms do?
- model physical laws like gravity, mass, and force
- let tremendous herds and flocks of creatures that appear to act independently, yet collectively
With computer-generated animation, how is hair on monster designed?
instead of animating each hair on monster’s head, monster’s fur is designed to behave like fur
Computer Graphics in Monsters Inc.
What is physics-based modeling?
each strand of hair is individually modeled
Computer Graphics in Monsters Inc.
How do textures and different types of light sources affect colour and light intensity at each pixel?
new ‘rasterization’ techniques for rendering (converting 3D model to 2D bitmap image)
What is rasterization?
taking an image described in a vector graphics format (shapes) and converting it into a raster image (series of pixels, dots or lines, which, when displayed together, create the image which was represented via shapes)
What is needed in computer graphics in Monsters Inc.?
much more computing power needed using specialized graphics processing units
Computer Graphics in Frozen
What does physics-based modelling of snow’s solid and fluid properties rely on?
- modeling many very small particles of snow
- controlling properties of particles such as strength, viscosity (gooeyness – clumping again) or hardness
- velocity and direction of particles depend on properties and collisions with other particles or objects
Computer Graphics in Frozen
What are renderfarms?
30,000 specialized graphics processors working in parallel to render frames
What can movie directors use computer-generated animation for?
merge real cameras with VR rigs to specify movies that look incredibly real
How many bits does one hexadecimal digit represent?
4 bits
to represent 16 numbers in binary, you need 4 digits
How many hexadecimal digits do you need for 1 byte?
2 hexadecimal digits