Question: Using C++ Write multiple programs that read a PGM image from file inImage.pgm and outputs a modified image to outImage.pgm a. Write a prorgram that

Using C++

Write multiple programs that read a PGM image from file "inImage.pgm" and outputs a modified image to "outImage.pgm"

a. Write a prorgram that inverts all colors, so white becomes black and black becomes white

b. write a program that inverts the colors only in the right half of the picture

c. write a program that draws a white box exactly in the middle of the picture. the dimensions of the box should be 50% by 50% of the original pictures width and height

d. same as C, but it should be a frame exactly one pixel thick

e. Scale the original picture to 200% of its size, Can be done by increasing the size of the picture by the factor of 2, and copying each pixel of the input as a small 2x2 square in the output

f. pixealte the input image, so make every 2x2 non-overlapping window contain the same value (averaged over all the pixels in that window of the input)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!