What value will be in those pixels after your function runs

Assignment Help JAVA Programming
Reference no: EM131104572

Write a function called posterizeMe(). Your function should take a picture as an input parameter. The first line of your functions should look something like this: def posterizeMe(picture):

Your function should do the following for every pixel in the picture (in this order):

- If the original red value of the pixel is greater than or equal to 90, set the new red value of the pixel to 255

- If the original blue value of the pixel is less than 90, swap the values of the red and blue for that pixel e.g., make the new blue equal to the old red, and the new red equal to the old blue)

- If the original red value of the pixel is greater than 80 and less than or equal to 167, set the new red value of the pixel to the original green value

- If the original green value is greater than 130, set the new green value to 130.

- If the original green value is less than or equal to 130, set the new red value to the absolute value (hint: function abs()) of the original blue value minus the original red value

Test your new function with various pictures. Use the writePictureTo function to save one posterized image, and the original image. You will be submitting these images along with your py file.

Make sure you have added appropriate comments for your new function.

Analysis Questions: answer this questions as a comment below your function

(a) If your picture had a pixel color pure red (RGB = 255, 0, 0) and another pure blue (0, 0,255), what value will be in those pixels after your function runs?

(b) It is important to store the original red, green, and blue values before you start. Why?

Reference no: EM131104572

Questions Cloud

How should this settlement be reported in the 2004 : How should this settlement be reported in the 2004 financial statements? Discuss.
Determine the heat received from the hot source : Determine the Carnot efficiency associated with the present power plant and compare it with the previous result.
Experienced consumer surplus : Share 2 experiences where you experienced consumer surplus. (you paid less than you otherwise would have been willing to pay). Also share your thoughts on why the surplus happened, in other words why did you think you would pay more than you did.
What are three pros of social media : What are three pros of social media? and What are three cons of social media? When listing the pros and cons; explain your reasoning.
What value will be in those pixels after your function runs : If your picture had a pixel color pure red (RGB = 255, 0, 0) and another pure blue (0, 0,255), what value will be in those pixels after your function runs
Briefly describe the physical or mental health issue : Briefly describe the physical or mental health issue you have selected. Compare (similarities and differences) the following factors for men and women: The incidence, mortality rate, diagnosis, and prognosis of that health issue.
Proper accounting suggests that the unusual gain : Proper accounting suggests that the unusual gain be reported as an extraordinary item. Illustrate an appropriate presentation of these items in the income statement.
Foundations and components of psychoanalysis : Discussing the foundations and components of psychoanalysis. Evaluate the contributions and criticisms of psychoanalytic models to the explanation of human behavior.
Problem of time lags in enacting and applying fiscal policy : Explain the problem of time lags in enacting and applying fiscal policy. What is the difference between the national debt and a budget deficit? How does the crowding-out effect relate to fiscal policy?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd