We're Hiring!

How to write pixel size in metadata

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

How to write pixel size in metadata

Postby JohannesL » Wed Aug 12, 2015 12:22 pm

Hello,
I have a relatively simple question for which I could not find an answer on the ImageJ listserv or the Bioformats forum.

After taking an image, how can I add the correct metadata on pixel size in order to have it read properly by ImageJ/Bioformats? It does not seem to be enough to change “Exif.Image.XResolution” and “Exif.Image.YResolution”.

I would like to do this for jpg and for tiff.
The background is that I made a small program to remote control the DSLR on a microscope. Since for each objective, pixel size changes, I have to add the actual dimensions accordingly.

Thanks in advance for help.
Johannes
JohannesL
 
Posts: 1
Joined: Wed Aug 12, 2015 10:34 am

Re: How to write pixel size in metadata

Postby mlinkert » Tue Aug 18, 2015 2:20 am

Hi Johannes,

After taking an image, how can I add the correct metadata on pixel size in order to have it read properly by ImageJ/Bioformats? It does not seem to be enough to change “Exif.Image.XResolution” and “Exif.Image.YResolution”.

I would like to do this for jpg and for tiff.


For TIFF, setting tags 282 and 283 (X and Y resolution, see http://www.awaresystems.be/imaging/tiff ... ution.html) is sufficient. You will need to set these tags in the first IFD though, not in a separate EXIF IFD.

Bio-Formats doesn't currently set the physical pixel sizes for JPEG files, but we can add that in 5.1.4 (see https://trello.com/c/bTLXSRkH/45-set-ph ... jpeg-files). If you set either tags 282 and 283 or tags 37390 and 37391 (plus unit tags as appropriate, see http://www.exiv2.org/tags.html), that should be supported in future releases.

Regards,
-Melissa
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: Google [Bot] and 1 guest