data loss in jpeg

3 views (last 30 days)
naval solanki
naval solanki on 13 Feb 2017
Commented: DGM on 5 Feb 2023
how much data loss (in %) image compression method the 'JPEG'

Accepted Answer

Walter Roberson
Walter Roberson on 13 Feb 2017
JPEG can be configured between no data loss and 99% data loss.
See the imwrite() 'quality' parameter, and 'mode', 'lossless'
  1 Comment
DGM on 5 Feb 2023
For passers-by, I should note that setting the 'quality' parameter to 100% does not make the process lossless.
% generate a small synthetic image with flat regions and hard edges
inpict = im2uint8(rand(10,10,3));
inpict = imresize(inpict,5,'nearest');
% 100% is the best, right?
fname = 'test.jpg';
jpegged = imread(fname);
% ... not quite.
You'd actually have to specify that you want lossless mode, as Walter mentions.

Sign in to comment.

More Answers (0)


Find more on Denoising and Compression 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!