0% found this document useful (0 votes)
21 views5 pages

CSP - Mobile 3.3 Representing Images

Computer Science Principles CSP- Mobile 3.3 Representing Images

Uploaded by

ortizinaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

CSP - Mobile 3.3 Representing Images

Computer Science Principles CSP- Mobile 3.3 Representing Images

Uploaded by

ortizinaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Mobile CSP | Student Lesson

Unit 3 | Image Representation


Course Listing: http://course.mobilecsp.org

RLE Introduction
How can computers store pictures when they can only use binary numbers? How can we
compress images so that they are faster to transmit and easier to store? Screens and images are
divided up into a grid of small dots called pixels (picture elements). The letter “a” has been
magnified below to show the pixels. When a computer stores a picture, all that it needs to store is
which dots are black and which are white.

1, 3, 1
4, 1
1, 4
0, 1, 3 ,1
0, 1, 3, 1
1, 4

The picture above shows us how a picture can be represented by numbers using Run Length
Encoding (RLE) used in fax machines. The first line consists of one white pixel, then three
black, then one white pixel, represented as 1, 3, 1. The first number always relates to the
number of white pixels. If the first pixel is black, the line will begin with a zero.

RLE Exercises
1. Try drawing in the following RLE compression and see if you get something you
recognize. Remember the first number in each row is the number of white pixels.
0, 6
4, 1, 1
3, 1, 2
2, 1, 3
1, 1, 4
0, 6
Mobile CSP | Student Lesson
Unit 3 | Image Representation
Course Listing: http://course.mobilecsp.org

To color the cell, select the cell(s), then set the background color:

2. Create your own black and white picture(for example, the first letter of your first/last name or
a number) and then write down the RLE encoding for it.

Fill in the RLE numbers for each row below (remember to start with the number of white pixels
(0 if there are none) and alternate)
------------------------------------------------------------------------------------------------------------------------------
Run-Length Encoding: N

Row 1: __0,1,4,1_________________
Row 2: ___0,2,3,1_______________
Row 3:___0,1,1,1, 2,1_________________
Row 4:__0,1,2,1,1,1__________________
Row 5:___0,1,3,2_________________
Row 6:__0,1,4,1__________________
Mobile CSP | Student Lesson
Unit 3 | Image Representation
Course Listing: http://course.mobilecsp.org

3. Color Images: draw an image with three different colors.

Fill in the color codes and the RLE numbers for each row below. Use an initial number to
represent the color (for example 0 for white, 1 for black, 2 for red or diagonally shaded) before
you write down the number of pixels of that color. For example, 0, 4, 2, 3 means white 4 pixels
followed by red 3 pixels in that row.
-------------------------------------------------------------------------------------------------------------------------------
Run-Length Encoding: Circle

Row 1: __2,2,1,1,0,1,2,2______ Color Key: 0 = _Light Pink______


Row 2: __2,1,0,1,2,2,1,1,2,1_____ 1 = _Light Grey_________
Row 3:__1,1,2,4,0,1___________ 2 = _White_____
Row 4:__0,1,2,4,1,1___________
Row 5:___2,1,1,1,2,0,0,1,2,1_____
Row 6:__2,2,0,1,1,1,2,2________
Mobile CSP | Student Lesson
Unit 3 | Image Representation
Course Listing: http://course.mobilecsp.org

Portfolio Reflection Questions


3.3 Representing Images Curriculum Page

Answer the following questions:

1. Decode this message by converting it from binary to ASCII: 1000001 1110000


1110000 0100000 1001001 1101110 1110110 1100101 1101110 1110100 1101111
1110010 0100000 1010010 1001111 1000011 1001011 1010011 0100001

Hint: You will need to convert from binary to decimal and then from decimal to ASCII. You can use this
chart to help you:https://www.eecis.udel.edu/~amer/CISC651/ASCII-Conversion-Chart.pdf

Answer

App Inventor ROCKS!

2. Describe what it means to say that JPEG is a lossy compression technique and
whether or not it affects the quality of camera pictures.

Answer

JPEG= a lossy compression technique-> reduces the file size of an image by permanently
removing some of the data/bits; makes it easier to store and share images
The Lossy Compression Technique removes less significant information, such as image
quality, that is not easily noticeable by the human eye

3. Give a specific example of a binary sequence that can represent more than one type
of data -- e.g., a number, a color, a character -- and describe how to interpret its
different values.

Answer
Mobile CSP | Student Lesson
Unit 3 | Image Representation
Course Listing: http://course.mobilecsp.org

Binary Sequence- 01011010

Character Interpretation: When used in text encoding, 01011010 is mapped to “Z” based
on the ASCII table.
Numeric Interpretation: When treated as a binary number, 01011010 is converted to its
decimal equivalent, which is 90.
Color Interpretation: In image processing, 01011010 could be interpreted as a pixel value,
where 90 represents a shade of grey closer to black (0) rather than white (255).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy