data loss in jpeg

2 visualizaciones (últimos 30 días)
naval solanki
naval solanki el 13 de Feb. de 2017
Comentada: DGM el 5 de Feb. de 2023
how much data loss (in %) image compression method the 'JPEG'

Respuesta aceptada

Walter Roberson
Walter Roberson el 13 de Feb. de 2017
JPEG can be configured between no data loss and 99% data loss.
See the imwrite() 'quality' parameter, and 'mode', 'lossless'
  1 comentario
DGM
DGM el 5 de Feb. de 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');
imshow(inpict)
% 100% is the best, right?
fname = 'test.jpg';
imwrite(inpict,fname,'quality',100);
jpegged = imread(fname);
% ... not quite.
imshow(jpegged)
You'd actually have to specify that you want lossless mode, as Walter mentions.
imwrite(inpict,'myfile.jpg','mode','lossless');

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Biomedical Imaging en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by