Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 5 Describe in English what this image or pixel function does def fun1:

ID: 3745949 • Letter: Q

Question

Question 5 Describe in English what this image or pixel function does def fun1: p = Pixel (0,0,0) return(p) Describe in English what this image or pixel function does def fun20: p = Pixel (255,255,255) return(p.) Describe in English what these image or pixel functions do and what are their difference. def fun3 (p) def fun4(p) r p.getRed() g = .getGreen() b p.getBlue() r = p.getRed() return(q) q = Pixel(x,x,x) return(q,) Describe in English what this image or pixel function does def fun5 (p) r = 2*p. getRed ( ) %256 g -p.getGreen) b-2*p . getBlue ( )%256 q-Pixel(r,g,b) return(q)

Explanation / Answer

please give thumbs up, thanks

def fun1():

p=Pixel(0,0,0)

retrn (p)

This function create a pixel p and its Red value=0, Green value=0, Blue value=0;, then retrning pixel pixel(In general its create a black pixel and returning)

def fun2():

p=Pixel(255,255,255)

retrn (p)

This function create a pixel p and its Red value=255, Green value=255, Blue value=255;, then retrning pixel pixel(In general its a creates a white pixel and returning)

def fun3(p):

r=p.getRed()

g=p.getGreen()

b=p.getBlue()

x=(r+g+b)//3

q=Pixel(x,x,x)

retrn (q)

This Function takes pixel p as input, and extracting reg, green,blue color from pixelthen averagin their value

then creating a new pixel q, where red,green,blue's value is set average color of pixel color

then return pixel q

def fun4(p):

r=p.getRed()

q=Pixel(r,r,r)

retrn (q)

Here function taking input a pixel p and extracting red color of p and and creating a new pixel q whose red,green,blue value are redpixel value of pixelthen pixel q is return by function

The main difference between fun3 and fun4 is fun3 is creating an average color image where fun4 creating gray level image

def fun5(p):

r=2*p.getRed%256;

g=p.getGreen();

b=2*p.getBlue%256;

q=Pixel(r,g,b)

return q

Here function taking input pixel p and exctraing red green blue from pixel/image q, and making color red and blue double,

then using those value creating a new pixel, it actually, increasing contrast of image or pixel

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote