Compute negative image processing pixel by pixel
Mostrar comentarios más antiguos
Hi, so I just started using MATLAB, and I need to solve this exercise: "iven a 24bpp Image, write a MATLAB code to compute the "negative image". The solution must reach the result by processing pixel by pixel." I assume I have to use a for loop to process pixel by pixel; til now, I found this possible solution:
>> a = imread('nameOfTheImage.png');
>> d(:,:,3) = 255 - a(:,:,3);
>> d(:,:,2) = 255 - a(:,:,2);
>> d(:,:,1) = 255 - a(:,:,1);
>> imshow([a,d])
but I think it's too simple. Can you help me with some indications? Thank you in advance!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!