Maximum of the image size png Matlab
Show older comments
Hello,
I have a matrix T (1, 2761843)
I want save it as like an image .png. I used the following line:
Imwrite (T,['image' num2str(5) '.png']);
I just get the following error.
Error using pngwritec
PNG library failed: image size exceeds user limits in IHDR.
Error in writepng (line 280)
pngwritec(data, map, filename, colortype, bitdepth, ...
Error in imwrite (line 546)
feval(fmt_s.write, data, map, filename, paramPairs{:});
No problem with JPEG 2000.
How I can find the maximum of image size .png (width and length) that we can create it with Matlab?
Thank you!
1 Comment
Rik
on 8 Jul 2020
You could try if the savepng mex function on the FEX suits your needs. I'm very far from fluent in C++, but it doesn't look like there is a limit imposed beyond the png format itself.
If you want to use Matlab tools, you could consider reshaping your data, prepending the true size and padding with zeros.
Accepted Answer
More Answers (1)
Image Analyst
on 8 Jul 2020
0 votes
If you want to save your 1-D vector as a 2-D image, I suggest you resize it first using reshape().
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!