image arithmetic result not the same
Show older comments
Good evening, I have a question about image arithmetic. Below is some code that reads in a grayscale image and performs arithmetic on it. I want to know why the modified image does not look the same when we essentially divided the image pixels by 64 and then multiplied the result by 64. the resulting image should have been identical. Below is the image of the result:

b=imread('blocks.jpg');
class(b); %shows it is a uint8 image
b2=(b/64)*64;
subplot(1,2,1)
imshow(b)
title('original image')
subplot(1,2,2)
imshow(b2)
title('modified image')
Accepted Answer
More Answers (1)
Steven Lord
on 26 Feb 2018
How many unique values can the results of (b/64)*64 take on?
b = intmin('int8'):intmax('int8');
b2 = (b/64);
unique(b2)
1 Comment
Aaron Connell
on 26 Feb 2018
Categories
Find more on Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!