Expand description
§Sketchbook Open Raster Library
This library provides functions to read and extract data from tiff files as created by Autodesk Sketchbook and export them as Open raster files that can be opened / modified in Gimp or Krita. Notably thie is done while retaining layer information.
The tiff files from Sketchbook include layers as seperate images (ifds) in private tiff tags. Information about the specific tiff format can be found at Aware Systems. The tiff parsing functionality of TiffTools was referenced when creating parts of this library.
§What’s special about Sketchbook Tiffs?
Tiff files are used as a storage mechanism for Autodesk Sketchbook images. Normally tiff files do not include layer information
(ie they are single layer) but they do allow somewhat arbitrary data to be stored in them by including multiple IFDs
(image file directory) in a single image file or by including additional data in Tags (which are stored inside IFDs).
Sketchbook takes advantage of this by storing a composite version of the image (all the layers merged) as the main image
in the tiff file and putting all the layers (and thumbnail) in different IFDs inside the IFD of the main composite image.
This way, any program can open the tiff file and get the correct image, but if it doesn’t support Sketchbook’s specific way
of manipulating tiffs for layers, then only the composite image shows up (ie the layers are lost).
As best I could find, there are no applications (other than Sketchbook) that support this tiff format. While this isn’t
a ‘normal’ way to store layers, if what you are doing is documented its just as valid as anything else. As it turns out
there is limited documentation about this format (noteably none from Autodesk directly). The tag used to specify this
proprietary format is called Alias Layer Metadata
and there is a bit of documentation for the image format at
Aware Systems.
§Usage
This library was primarily made in service of a small command line app to convert files. If you just want to convert some files
then SketchbookTiffConverter is probably what you actually want. If you want
to make your own app to convert files then the library might help you out. As the library was made in service of SketchbookTiffConverter,
the main functionality of this library is wrapped up into the convert_file
function. That is the best place to start if you are
hoping to convert some files in your app. All the relevant sub-functions are exposed so you can go to any level you want to in processing
your own files.
Modules§
- endian_
rw - Endian Read and Write
- ora
- Open Raster File Format
- tiff
- Sketchbook Tiff
- tiff_
types - Rust types to work with Tiff data
Functions§
- bgra_
to_ rgba - Convert BGRA image to RGBA
- convert_
file - Convert a Sketchbook Tiff file to an Open Raster file
- fill_
color - Fill a dynamic image with a specified color
- ifd_
to_ ora_ element - Create a piece of an ora file (composite, layer, thumbnail) for the given piece of a tiff file (ifd)
- image_
to_ buf - Export an Image buffer to a png