Looking at the documentation for imwrite it appears that the 'Compression' parameter is only supported with HDF5 or TIFF, and only HDF5 supports 'rle' compression. My guess is that you tried to adapt an example that wrote an HDF5 file to write a .jpg file, but forgot or didn't realize that you needed to remove the 'Compression' arguments.
imwrite doesnt work help
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a grayscale image with size '3520x4280 uint8'. Now I want to compress this image with imwrite by using 'Compression' tool. I call;
imwrite(image1,'test.jpg','Compression','rle');
However I get this error message:
Error using writejpg>set_jpeg_props (line 173)
Expected input to match one of these strings:
quality, comment, bitdepth, mode
The input, ''compression'', did not match any of the valid strings.
Error in writejpg (line 50)
props = set_jpeg_props(data,varargin{:});
Error in imwrite (line 473)
feval(fmt_s.write, data, map, filename, paramPairs{:});
I use MatlabR2013a. Does anyone know what I missed? Thanks a lot
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 HDF5 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!