[filename, pathname, filterindex] = uigetfile('\*.tif', 'File Selector'); %Select File
addpath(pathname)
img = imread(filename);

imreduced = img-1;

file_name = strcat(filename);
PathName = uigetdir('','Save Location');  %Set Save location
cd(PathName)
imwrite(imreduced,file_name,'tif') %Image saved as .tif
cd('') %Set directory