Menu

[Solved]Function Name Whoneedsphotoshop Inputs 1 Char Filename Image Posterize Double Number Color Q37117045

Matlab help please Function Name: whoNeedsPhotoshop Inputs: 1. (char) filename of an image to posterize (double) the number of color intervals t

Function Name: whoNeedsPhotoshop Inputs: 1. (char) filename of an image to posterize (double) the number of color intervals to have 2. File Outputs 1. The posterized image Background: Photoshop is a great image processing tool. But someone had to write the code behind this easy interface. You will make a function that mimics the posterize effect in MATLAB code Function Description: The posterize effect works by reducing the number of colors in an image. To start, take the range of possible pixel values (0 to 255) and split it into the number of intervals given by the second input. These intervals should be even size Then for each pixel in the image, figure out which interval the red, green, and blue values are in. Replace a pixel’s color value with the middle of the interval it falls into. The resulting image should be written to a new file with ‘_posterized’ appended to the end of the original file name Example If the input image is a single pixel that looked like 85 169 and the number of color intervals is 6, then the intervals would be [0, 42.5), [42.5, 85), [85, 127.5), [127.5, 170), [170, 212.5), [212.5, 255] The result of the function would look like 106 21 Notes: . The values for each color within each pixel should be changed separately. So a pixel’s new red value does not depend on it’s green or blue values . If there are decimals in your final value calculations, they should be rounded to the nearest whole integer If a value falls on the border between 2 intervals, it should go the upper interval . Hints Think about using the linspace() function to create the intervals . Show transcribed image text Function Name: whoNeedsPhotoshop Inputs: 1. (char) filename of an image to posterize (double) the number of color intervals to have 2. File Outputs 1. The posterized image Background: Photoshop is a great image processing tool. But someone had to write the code behind this easy interface. You will make a function that mimics the posterize effect in MATLAB code Function Description: The posterize effect works by reducing the number of colors in an image. To start, take the range of possible pixel values (0 to 255) and split it into the number of intervals given by the second input. These intervals should be even size Then for each pixel in the image, figure out which interval the red, green, and blue values are in. Replace a pixel’s color value with the middle of the interval it falls into. The resulting image should be written to a new file with ‘_posterized’ appended to the end of the original file name Example If the input image is a single pixel that looked like 85 169 and the number of color intervals is 6, then the intervals would be [0, 42.5), [42.5, 85), [85, 127.5), [127.5, 170), [170, 212.5), [212.5, 255] The result of the function would look like 106 21 Notes: . The values for each color within each pixel should be changed separately. So a pixel’s new red value does not depend on it’s green or blue values . If there are decimals in your final value calculations, they should be rounded to the nearest whole integer If a value falls on the border between 2 intervals, it should go the upper interval . Hints Think about using the linspace() function to create the intervals .

Expert Answer


Answer to Function Name: whoNeedsPhotoshop Inputs: 1. (char) filename of an image to posterize (double) the number of color interv… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *