Problem saving an image as jpg
12 views (last 30 days)
I am running a procedure in several images and I am trying to save a smaller jpg image (along with a lossless tif image) for quick inspection to make sure the program runs ok. So far I never had troubles and the program has run successfully for 200 images and saved the equivalent results.
Today one of the images failed to save and gave me this error message
''Error using wjpg12c
JPEG library error (12 bit), "DCT coefficient out of range".
Error in writejpg (line 127)
Error in imwrite (line 485)
The same image was previously saved as a tif with no problems. The command i used to save the image as jpg is
Has anyone encountered this error before? I am using Matlab 2018a.