
For every pixel in image, there are "analogous" pixels at the same x,y in image2 and image3.
New simpleimage javascript code#
The provided code loads these images into variables image, image2, and image3. Use the avg technique with a green-high strategy to detect the green background.įor this problem, we have three images which are all the exactly same size: img.jpg img2.jpg img3.jpg. Write bluescreen code to replace the green background with pixels from moon.jpg. The bird.jpg image shows a red bird with a green background. Write code to fix the image by making the following changes to each pixel: set the red value to 0, and multiply the green and blue values by 10. Then multiply the blue value by 20.įor this problem, the puzzle.png image has been distorted. Write code to change each pixel in the image as follows: set both red and green to be 5 times the original blue value. This is like a 5-10-20 puzzle, but not exactly. It's fine to use literal numbers in your code to identify the parts of the image (as we did in lecture), or any other technique which gets the correct result. Write code to change the top half of the image as follows: double the green value of each pixel.

Suppose the spring.jpg image is 500 pixels wide by 250 pixels high. What are the red, green, and blue values to convert this pixel to grayscale, as we did in lecture and on the homeworks: Suppose we have a pixel with these values: red:100 green:150 blue:50. What were the original samples and is this a lossless or lossy compression scheme: Suppose we have these samples in compressed form: 1000, +2, +3, -1, +2. In lecture we described a compression scheme that records the first sample number, and thereafter just the "delta" difference of each Give an example of a signal traveling by an analog process through at least 2 mediums: What is another right typically granted to users of open source software:
New simpleimage javascript software#
Open source software is typically free to download andįree to run. How much capacity is required to store a picture of each person (in GB): Suppose there are 20,000 people at Stanford, and a single picture requires 8 million bits. How many GB does it take to record 24 hours (in GB):

Suppose we have a video camera that records at a rate of 500,000 KB per hour. How many bytes are required to encode the text of this message: FOMO! How many different patterns can be represented with 7 bits:į. According to the 2-year definition of Moore's law, how many years must pass until I can buy a 64 GB SD card for about the same price:Į. One year I bought a 32 GB USB flash drive. What is the name of the system that manages the starting and stopping of programsĭ.

Suppose you try to run a program on your computer,īut the programs fails to start because your computer has run out of something. In your answer, circle the system that runs machine code:ī. Name the three main hardware systems of a computer. pixel.getRed() // likewise for green and blueĪ.
