Well, it's kinda hard to help given that we don't know how the picture is stored, or what libraries you're using (or are these console "pictures"?) or what algorithm you're supposed to use for scaling the image.
t3_0.PGM t3_3.PGM rescale 330 580
ImageViewer2 console pictures
Two-dimensional matrix as an array of values, where each value represents a degree -
Particular pixel gray field of [0,255] when it's 0 white and 255 black : image we will be working on it.
shown below and the initial large is 800 * 600 pixels.
To view photos we have provided you with a view tool called ImageViewer2 sure to use it and not others
The idea is one of sampling. Given an index x into the range [x0, xN-1]:
how do you convert that x to a y in the range [y0, yM-1]?
Answer: if the index is some percentage of the way across the xs, it should be the same percentage across the ys. A little math and you can convert the index from one range to an index into the other range. (Remember that a percentage value must be floating point, while indices are integers.)
You will need to work backwards. Your xs are the target image (the one you want to create), and the ys are the source image (the one you want to scale).
The tricky part is deciding how to get colors out of the source, since the percentage across will rarely be exactly on a source pixel. You have three basic options:
(simplest) truncate the percentage to an integer index and use that pixel value
(simple) choose the source pixel closest to the percentage
(not simple) do the same percentage thing to the pixels on either side of the percentage point to get the proper grayscale value.
I recommend, actually, that you do the (simplest) first, so that you can see some working results, then add the (simple) or (not simple) approach.
Can we just use the image sizing function to strech image by changing image width and heigth and adjusting image resolution, which comes from an image processing library?