MATLAB: How to read and resize and change color image from URL link in our MATLAB commands

computer visionimage processingMATLAB

How to read and resize and change color image from URL link in our MATLAB commands?

Best Answer

I am assuming a few things here and you can modify it to suit your requirement
% read image from url (I took a random image on internet)..
[url_img, map] = imread('https://static.pexels.com/photos/14621/Warsaw-at-night-free-license-CC0.jpg');
figure, imshow(url_img), title('Image from url')
% resize it..
resized_img1 = imresize(url_img, 0.2); % resize by a factor here 0.2
resized_img2 = imresize(url_img, [600 500]); % resize to a specifiv dimensions
% there are many ways of interpolation to perform resizing
resized_img3 = imresize(url_img, 0.2,'method','nearest'); % rsize by a specific interpolation method
figure, imshow(resized_img1), title('Resized image')
% change color did you mean from RGB to grayscale
gray_img = rgb2gray(resized_img1);
figure, imshow(gray_img), title ('Grayscale image')