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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started