Untitled
unknown
plain_text
a year ago
470 B
8
Indexable
% Load the image
img = imread('ngc6543a.jpg'); % Replace 'peppers.png' with your image
% Convert to grayscale if the image is in color
if size(img, 3) == 3
img = rgb2gray(img);
end
% Calculate the negative of the image
negativeImg = 255 - img;
% Display the original image
subplot(1, 2, 1);
imshow(img);
title('Original Image');
% Display the negative image
subplot(1, 2, 2);
imshow(negativeImg);
title('Negative Image'); Editor is loading...
Leave a Comment