A CUBE file is a plain-text 3D Lookup Table (LUT) format originally defined by Industrial Light & Magic (the team behind Star Wars). It maps input RGB values to output RGB values.
Map Cube Elements to XMP Namespaces
XMP uses extensible schemas. Create a custom schema for cube data:
Generate XMP Packet
Using a tool or script (Python with pyxmp or exiftool): convert-cube-to-xmp
# Pseudocode
from libxmp import XMPFiles, consts
xmp = XMPFiles()
xmp.open('output.jpg', open_as=consts.XMP_OPEN_FOR_UPDATE)
xmp.set_property('http://yournamespace.com/cube/', 'Dimensions', 'Time, Product, Region')
xmp.set_property('...', 'Sales_Amount', 125000)
xmp.close()
Embed into Target File
Use exiftool (command line) to write XMP:
exiftool -XMP-cube:Dimensions="Time,Product" -XMP-cube:TotalSales=45000 target.pdf
The core conversion steps are:
Resample (if needed)
Encode as base64
Generate XMP container
Save as .xmp
The convert-cube-to-xmp tool is a utility designed to convert cube files to XMP (Extensible Metadata Platform) files. This guide will walk you through the process of using this tool to convert your cube files.