How can I load a tif file and save it again with the same parameters as before?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to load a tif file and save it again, but the saved file is not the same like the original file. helgoland_bathy.tif is a bathymetry map with georeferenced coordinates. The problem is that the second file has the wrong entries in the info parameter. Like PixelScale, RefMatrix and so on. It is possble to get all ifnormation from the tif file and save this again as a new tif with the identical information?
infilename = 'helgoland_bathy.tif';
[A,R] = readgeoraster(infilename);
info = geotiffinfo(infilename);
geoTags = info.GeoTIFFTags.GeoKeyDirectoryTag;
geotiffwrite('helgoland_bahty_2.tif',A,R,'GeoKeyDirectoryTag',geoTags)
0 commentaires
Réponses (1)
arushi
le 22 Août 2024
Hi Jonas Müller
The problem lies in the size of the image. MATLAB has a limitation where it can only save images in the traditional “TIFF” format that are up to 2^32-1 bytes in size, due to its 32-bit restriction. While MATLAB's version of ‘libtiff’ can handle and read 64-bit TIFF images, it cannot write them.
For further details and additional information, you can consult the following blog: http://blogs.mathworks.com/steve/2013/08/07/tiff-bigtiff-and-blockproc/
Hope this helps.
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!