How to keep the pixel values same for writing an image
8 次查看(过去 30 天)
显示 更早的评论
In attach picture the pixel matrix D is written as an image but if i read the same image from the written one I found that all pixel values except zero are converted to 255. Why this is happening? Is there any solution to keep the pixel values same after writing it?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167805/image.png)
0 个评论
采纳的回答
更多回答(1 个)
rcjr15
2018-2-19
Hi Shamim, Try using this: imwrite(YourImage, 'YourFile.jpg', 'mode', 'lossless') if you want to write it as JPEG file.
Or you can use PNG or TIFF extension which are lossless compression standards.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!