If you just want to amplify the red values by a factor of 1.5678 then:
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
amplitudeFactor = 1.5678;
redChannel = uint8(double(redChannel) * amplitudeFactor);
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
imshow(rgbImage);
In your code, there is no reason to ask for the image file format and pass it in to imread unless the image does not have a file extension or the file extension is incorrect. If that's the case it would be better to correct that rather than to ask for format and pass it in. imread() will figure out the format from the filename extension.
Best Answer