Session Aims
- Use the File Information Toolkit (FITS) to identify an files format
- Use FITS to validate that an image is well formed and valid
- Use OpenJPEG to create JPEG 2000 images.
- Use OpenJPEG to convert JP2Ks to TIFF images.
- Use the tiffcmp utility to on converted files to check that they're the same
If There's Time
- Use ImageMagick compare to QA images for similarity
- Use ImageMagick to convert our source and result files to GIFs for QA comparison
- Use the imgcmp utility to on converted files to check that they're the same
Session
Installing imgcmp for Image Comparison
First we'll install the comparison tool as it's not on the vm
Using FITS
The Harvard FITS toolkit wraps a set of Digital Preservation utilities. Let's see the help page and find out what version we're running:
We'll now set up a small directory to allow us to experiment with a single image
So we're going to use FITS to identify the format of files first:
So that's a LOT of information, let's see if we can get the format string alone, with the help of grep and a regualr expression, to get the format:
So we can see that this is a tiff image, the following lines check for
We now know that this is and uncompressed TIFF image that is "well-formed and valid", these terms are used by JHOVE , one of the toolswrapped by FITS. JHOVE explains the terms as follows:
- A digital object is well-formed if it meets the purely syntactic requirements for its format.
- An object is valid if it is well-formed and it meets the higher-level semantic requirements for format validity.
Finally we'll use FITS to check for image compression, OpenJPEG, the tool we're using to convert, only works with uncompressed TIFFs.
Finally let's take a look at the image:
Using OpenJPEG to convert to JPEG 2000
We're now going to look at the OpenJPEG compress tool that can be used to convert TIFF images to JPEG 2000, let's take a look at the manual first (press q to quit it).
So to create a JPEG 2000 from our original
We're now going to use the Jpylyzer tool to ensure that our converted file is actually valid:
Now, as a final check we'll convert back to TIFF and use a comparison tool to test the conversion.
Which creates a TIFF from our copy, now we'll compare our original TIFF with our twice converted TIFF
This means that our image has converted successfully , there's only a small difference in the image tags, but the image data is as it should be.
We can assess visually: