Problem when using imwrite command

1 Ansicht (letzte 30 Tage)
Majid Al-Sirafi
Majid Al-Sirafi am 25 Jun. 2016
Kommentiert: Majid Al-Sirafi am 25 Jun. 2016
Hi every one I have a problem when I use imwrite command, for example suppose that I have first.jpg image, when I want to write it into a new image, for example second.jpg, as follows:
A=imread('first.jpg');
Imwrite(A,'secod.jpg');
The values of the pixels in the second.jpg is not exactly same as the values of the pixels in the first.jpg What is the wrong?
Regards

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 25 Jun. 2016
What is wrong is that JPEG defaults to using lossy compression. If the compression level used for the file does not exactly match the default compression level used by imwrite() then you would get different results.
Moral of the story: never use regular JPEG for anything other than presentation purposes, where the human eye is the limitation; do not use regular JPEG for scientific analysis. Use a lossless format instead such as PNG or TIFF.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by