Question: Write a C program to merge two given binary-based ppm files (P6). The names of the two given image files and the name of the

Write a C program to merge two given binary-based ppm files (P6). The names of the two given image files and the name of the combined image file are given as command line arguments. The combined image is obtained by putting the second image to the top-right corner of the first image. The sizes of the given image files are not fixed. If the width or the height of the first image is less than that of the second, your program should report error. All these image files can be opened with image viewer tools that can work with ppm file format.

For simplicity, the following restrictions are added to the file format of the input:

no comment line after the file type specification

width (number of columns) and height (number of rows) formatted as ASCII decimal in the second line

maximal value of color components given in the third line You need to prepare the image files.

No sample files are provided. This is a practice on using System Call I/O. You are not allowed to use standard I/O library functions or other graphics related libraries.

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!