wiki:Cutting out images

Version 5 (modified by Klaus Thoden, 13 years ago) (diff)

Script more or less finished.

Instructions for cutting out images

  1. The figures should be cut out of the TIFF-images, rather than the compressed JPG-images in online_permanent/library on foxridge. The Digigroup should know where the relevant images are.
  2. Do not cut out drop caps or embellishments, e. g. decorative images on the title page
  3. If there is already an xml-version of the text, it is handy to extract a list of all figures that are to be cut out. You can do this for example by using XQuery in the display system:
    //echo:figure
    
    resp.
    //echo:image
    
    Depending on how much context you like (with caption or not).
  4. Now, in the viewing environment, you can browse through the book, visiting the respective pages and mark the images using digilib's "zoom area" tool. Be careful not to cut out surrounding text, including the catchword at the bottom of the page. However, captions are to be cut out, as well. Some small images are only there for decorative purposes. The policy is not to cut out these ones. Lateron, these have to be deleted out of the xml file.
  5. Save the URLs of the pages with the zoomed area into a text file. Also, note in the file which images have to be removed from the XML. The list should be stored somewhere for future reference (e. g. in case the figures are not produced by cutting the files, but by extracting the figures on the fly). The first list was generated for Apian 1550.
  6. On the basis of this text file, the Python script cut_images.py (attached to this page) takes care of cutting out the images from the original TIFF files and saves them in the desired format page-imagenumber (e. g., if pageimage 0056.tif has three figures, these figures will be saved as 0056-01.tif, 0056-02.tif and 0056-03.tif), by calling Imagemagick's commands identify and convert. They are stored in a folder called figures
  7. This folder is then uploaded to the foxridge server alongside the pageimg-folder of the respective book: folder online_permanent/library/XXXXXXXX will then contain both a pageimg and a figures folder.
  8. It should be made sure that the excluded images are removed from the XML file.

Attachments (5)