How can read PNG image in actual size?
5 views (last 30 days)
Show older comments
I have tried to read image using imread but It read image with small size!
5 Comments
Walter Roberson
on 2 Jun 2019
You can possibly zip it and attach that.
Or you can put it up on google drive or dropbox.
Answers (2)
Image Analyst
on 2 Jun 2019
Obviously your screen is not 68 MB in size so you're either going to have to demagnify the image to see all of it, or you're going to have to just look at a small part of it, in its pixel-for-pixel true size, though a small window.
See my attached zoom demo, and also look into the function truesize().
4 Comments
Image Analyst
on 2 Jun 2019
He can drop it in his MATLAB online drive (preferably) and give us the link.
Alternatively use Google drive or dropbox or similar.
Walter Roberson
on 3 Jun 2019
That is not a PNG file, it is a DNG file, which is a TIFF variation used to store raw image data.
T = Tiff('L1.DNG');
offset = getTag(T, 'SubIFD');
setSubDirectory(T,offset)
imCFA = read(T);
This will give you Color Filter Array (CFA) data as uint16 -- sort of like Bayer Mosaicing
The imCFA array is 4000 x 5984 . Apple's Preview says the image is 5976 × 3992 after demosaicing.
Unfortunately Tiff class does not know about the tags needed to read the CFAPattern. Apple Preview says it is 2, 1, 1, 0, which would correspond to Blue, Green, Green, Red. Unfortunately I have not yet figured out how to decode the information.
The file includes a 599040 byte "MakerNotes" TIFF tag. https://owl.phy.queensu.ca/~phil/exiftool/idiosyncracies.html says that your particular model of Leica, Leica M (Type 240) has the most idiotic MakerNotes format out of all of the Leica models out of all camera manufacturers. Somewhere in there is a preview image.
6 Comments
Walter Roberson
on 4 Jun 2019
I am not at all confident as to interpretation, but parts of the file hint that there might be a 1920 x 1280 preview inside the file.
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!