How can read PNG image in actual size?

7 views (last 30 days)
Noor Abbas
Noor Abbas on 30 May 2019
Commented: Noor Abbas on 6 Jun 2019
I have tried to read image using imread but It read image with small size!
  5 Comments
Noor Abbas
Noor Abbas on 2 Jun 2019
I have tried to attached a copy of image but Matlab offer 2MB to attached not 68 MB.
Do you have another way to attached this image?
Thanks in advance
Walter Roberson
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.

Sign in to comment.

Answers (2)

Image Analyst
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
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.
Noor Abbas
Noor Abbas on 3 Jun 2019
Dear Walter Roberson and Image Analyst,
Could you please find link of image , the attached image is 46MB on mylaptop, but when read it in Matlab is 120*160 .
the link is
Thanks in advance

Sign in to comment.


Walter Roberson
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
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.
Noor Abbas
Noor Abbas on 6 Jun 2019
Thanks Walter Roberson for everything.

Sign in to comment.

Categories

Find more on Images 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!