clear clc close all % read the dog picture dog = imread('Pep.jpg'); image(dog) [height, width, colors] = size(dog) % crop out just the dog top = 700; bottom = 900; left = 600; right = 850; bigdog = dog( top:bottom, left:right, :); figure image(bigdog); axis image % amplify the image csc = (right - left)/width rsc = (bottom - top)/height nwidth = right - left nheight = bottom - top cindex = ceil(csc:csc:nwidth); rindex = ceil(rsc:rsc:nheight); ndog = bigdog(rindex, cindex, :); figure image(ndog) axis image % is that the best we can do? imwrite(ndog, 'nPep.jpg', 'jpg');