







































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








































































Question 1. What is the primary purpose of media digitization in media computation? A) To reduce the size of media files B) To convert media into a format that computers can process and manipulate C) To enhance the quality of media files D) To eliminate the need for storage devices Answer: B Explanation: Digitizing media converts analog media into digital form, allowing computers to process, analyze, and manipulate media data effectively. Question 2. Which programming language is specifically introduced for media computation in the book? A) Java B) C++ C) Python D) JES (Jython Environment for Students) Answer: D Explanation: JES is designed for media computation and is used in the book to help students learn programming through media manipulation. Question 3. In Python, which symbol is used to indicate a comment? A) # B) // C) /* */ D) & Answer: A Explanation: In Python, the hash symbol (#) is used to denote comments, which are ignored by the interpreter and used for explanations. Question 4. Which of the following best describes a string in programming? A) A sequence of characters treated as a single data type
B) A numerical value used for calculations C) A function that manipulates images D) A loop construct for iteration Answer: A Explanation: Strings are sequences of characters enclosed in quotes, used to represent text in programming languages like Python. Question 5. How can you create a string in Python? A) Using square brackets [ ] B) Using curly braces { } C) Using quotes " " or ' ' D) Using parentheses ( ) Answer: C Explanation: Strings in Python are created by enclosing characters within single (' ') or double (" ") quotes. Question 6. What does the 'for' loop in Python do? A) Executes a block of code repeatedly a specified number of times or over a collection of items B) Defines a function to perform tasks C) Declares a new variable D) Imports external modules Answer: A Explanation: The 'for' loop iterates over a sequence (like a list or string), executing its block of code for each item. Question 7. Which Python statement would you use to tell a story by constructing a string from other strings? A) print() B) + (concatenation operator) C) import D) def
Question 11. What is the purpose of the 'len()' function in Python? A) To find the length of a string or list B) To convert data types C) To generate random numbers D) To check if a variable exists Answer: A Explanation: 'len()' returns the number of items in a string, list, or other collections, useful for processing data. Question 12. How do you reverse a string in Python? A) Using slicing with a step of - 1, e.g., string[::-1] B) Using the reverse() method C) Using the 'reverse()' function D) Using the 'invert()' method Answer: A Explanation: Python slicing with a step of - 1 creates a reversed copy of the string. Question 13. Which of the following is a method to separate words in a string? A) split() B) join() C) strip() D) replace() Answer: A Explanation: The 'split()' method divides a string into a list of words based on whitespace or other delimiters. Question 14. What Python feature allows you to process each word in a string individually? A) Looping through the list returned by split() B) Using the 'replace()' method C) Concatenating strings
D) Using conditional statements only Answer: A Explanation: After splitting a string into words, a loop can iterate through each word for processing. Question 15. Which Python statement is used to test whether a string contains a specific word? A) 'in' operator, e.g., 'word' in string B) 'contains()' method C) 'test()' function D) 'find()' method only Answer: A Explanation: The 'in' operator checks if a substring exists within a string, returning True or False. Question 16. What is the main reason for manipulating pixel color values in images? A) To change the image resolution B) To alter the visual appearance, such as brightness or color tone C) To compress the image data D) To convert images into text files Answer: B Explanation: Modifying pixel color values changes how the image appears visually, enabling effects like brightening or color shifts. Question 17. Which color channels are typically manipulated in images? A) Red, Green, Blue (RGB) B) Cyan, Magenta, Yellow (CMY) C) Lightness, Saturation, Hue (LSH) D) Black and White only Answer: A Explanation: RGB channels represent the primary colors used in digital images, and manipulating them alters the image's color composition.
B) Remove the blue channel only C) Increase the red channel intensity D) Use only the green channel for display Answer: A Explanation: Converting to grayscale involves averaging or weighting the RGB channels so that each pixel has equal intensity across all channels. Question 22. What is the purpose of specifying a pixel by its index in an image? A) To access or modify the pixel's color values directly B) To resize the image C) To rotate the image D) To apply a filter to the entire image Answer: A Explanation: Pixel indices allow precise access to individual pixel data for manipulation or analysis. Question 23. Which technique can be used to create a red-eye effect in photos? A) Replace red pixels with darker or eye-colored pixels in the affected area B) Increase all blue pixels in the image C) Convert the image to black and white D) Add a blue border around the eye area Answer: A Explanation: Red-eye correction involves identifying and reducing overly red pixels in the eye region to restore natural eye color. Question 24. How does sepia toning affect a picture? A) Adds a warm brownish hue to give it an antique appearance B) Converts the image to black and white C) Increases the saturation of all colors D) Makes the image more colorful with vibrant hues
Answer: A Explanation: Sepia toning gives images a warm, brownish tint reminiscent of vintage photographs. Question 25. What Python conditional statement can be used to detect edges in an image? A) if pixel value differs significantly from neighboring pixels B) for loop only C) while loop only D) def statement Answer: A Explanation: Edge detection involves comparing pixel values with neighbors; significant differences indicate edges. Question 26. What is chromakey used for in image processing? A) Replacing a specific color (usually green or blue) with another image or background B) Enhancing the image resolution C) Applying a sepia tone D) Adding a border around the image Answer: A Explanation: Chromakey removes a specific background color, allowing replacement with other images or videos. Question 27. How can you add a border to an image in media computation? A) Draw a rectangle around the image edges with desired color and thickness B) Increase the image size without changing content C) Convert the image to grayscale only D) Remove all pixels at the edges Answer: A Explanation: Adding a border involves drawing a rectangle with the specified border color and width around the image edges.
D) Remove the blue channel altogether Answer: A Explanation: Increasing blue involves adding to the blue channel, ensuring it does not exceed maximum intensity. Question 32. Which of the following best describes the process of creating a sunset scene in media computation? A) Gradually changing the color palette to warm tones and adjusting brightness B) Adding a blue filter to the entire image C) Removing all red pixels from the image D) Applying a sepia filter only to the bottom half of the image Answer: A Explanation: Creating a sunset involves manipulating colors and brightness to simulate warm, sunset hues. Question 33. What is a common method to darken an image? A) Subtract a value from each pixel's color channels B) Increase the brightness of all pixels C) Convert the image to black and white only D) Remove random pixels randomly Answer: A Explanation: Darkening involves decreasing pixel color intensities uniformly or selectively. Question 34. Which technique would you use to create a negative of an image? A) Subtract each pixel's color value from the maximum (e.g., 255) B) Convert the image to sepia tone C) Increase all color channels by a fixed amount D) Rotate the image 180 degrees Answer: A Explanation: Negatives invert color values, producing a photographic negative effect.
Question 35. How do you convert a color image to grayscale in media computation? A) Set R, G, B channels to their weighted average for each pixel B) Remove all color channels C) Keep only the red channel D) Increase the saturation of all pixels Answer: A Explanation: Grayscale conversion averages or weights RGB channels to produce a monochrome image. Question 36. How can you specify a pixel in an image for modification? A) By its (row, column) index position B) By the pixel’s color name C) By the image’s filename only D) By its file size Answer: A Explanation: Pixels are addressed via their position in the image grid, enabling targeted editing. Question 37. Which of the following is an example of a conditional used in image processing? A) if pixel.color > threshold then change color B) for pixel in image C) while True: D) def process_pixel(): Answer: A Explanation: Conditionals like 'if' are used to apply effects only to certain pixels based on their properties. Question 38. What is the effect of increasing the green component in an image? A) The image appears greener, potentially altering the overall color balance B) The image becomes more bluish
Question 42. What is the main purpose of background subtraction in media processing? A) To isolate foreground objects by removing background pixels, often based on color similarity B) To enhance the background colors C) To crop the entire image to a smaller size D) To convert the image into grayscale only Answer: A Explanation: Background subtraction separates foreground from background by detecting differences in pixel values. Question 43. Which method is used to add a border around a picture? A) Draw a rectangle or line around the edges with specified color and thickness B) Resize the image to a smaller dimension C) Change the background color D) Convert to grayscale first Answer: A Explanation: Borders are added by drawing shapes or lines along the image perimeter with desired styling. Question 44. How do you adjust the brightness of an image? A) Add or subtract a constant value from each pixel's color channels B) Convert the image to black and white only C) Rotate the image D) Crop the image edges Answer: A Explanation: Brightness adjustment involves modifying pixel intensities uniformly across the image. Question 45. Which image effect involves converting a color image to shades of gray based on luminance? A) Grayscale conversion
B) Sepia toning C) Posterization D) Edge detection Answer: A Explanation: Grayscale conversion reduces the image to shades of gray, representing luminance. Question 46. How can you implement edge detection in an image? A) Compare neighboring pixel values and highlight significant differences B) Convert the image to black and white only C) Increase the red channel across all pixels D) Apply a blur filter to smooth edges Answer: A Explanation: Edge detection identifies boundaries by detecting sharp changes in pixel values. Question 47. What is the purpose of 'makePicture()' in JES? A) To create a new picture object for editing or displaying images B) To save an image to disk C) To load an existing image file D) To delete an image object Answer: A Explanation: 'makePicture()' initializes a new image or loads an existing one for processing. Question 48. Which function allows you to replace a range of colors in an image? A) range coloring or thresholding functions that set pixels within a color range to a new color B) 'split()' C) 'reverse()' D) 'save()' Answer: A