0

i need to copy the pixels from one image to another not all the pixels
int copy(image2,i,j,image1 k,j)
and return the image2
how to write the function completely

3
Contributors
3
Replies
5
Views
4 Years
Discussion Span
Last Post by Adak
0

What are image2, image1? Are they arrays? Paths? What format are the images? What do i,j, and k represent? You need to more clearly define the problem and show what you've already done. There are libraries available that support different formats, but you should be specific about what you need.

0

it is a greyscale image,im not using any library,trying to write the code in c,i and j are the coordinates of image1, k and j are the coordinates of image2,i have to copy the pixel of image1 to image2

0

1) You have to get the format of the pixel, in that type of picture - and there are many types of greyscale. You can google the format.

2) Make the number of variables (and type - probably unsigned char, but it could be int), you need, to correspond to your pixel's format.

3) write out the new data with the changes you made. Don't try to actually alter the file, in place.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.