I have a jpg picture which is black and white and I would like to convert black part to white and white to black( black pixel to white and vise versa ) in MATLAB
and save it as jpg file again.
I have tried this code but it just give me a black line in the white page.
im=imread('Export0000009111.jpg');
binstring = dec2bin(im, 8);
binImage = ~binstring;
binImage = 1-binImage;
binImage = (binImage == 0);
imwrite(binImage,'ss1.png');
Does anyone has any proper solution for that?
Thanks in advance!