<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1"> <TITLE>GraphicsMagick Motion Picture Features</TITLE> <META NAME="GENERATOR" CONTENT="StarOffice 8 (Solaris x86)"> <META NAME="CREATED" CONTENT="20020823;18090800"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGED" CONTENT="20080429;12202200"> <META NAME="CLASSIFICATION" CONTENT="Description of new features in GraphicsMagick to support the motion picture industry"> <META NAME="KEYWORDS" CONTENT="GraphicsMagick, DPX, Cineon, 268M"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <META NAME="CHANGEDBY" CONTENT="Bob Friesenhahn"> <STYLE TYPE="text/css"> <!-- @page { size: 8.5in 11in } TD P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } P { color: #000000 } P.western { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt } P.cjk { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } P.ctl { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } PRE { color: #000000 } DD { color: #000000 } DD.western { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt } H3 { color: #000000 } H3.western { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } DT { color: #000000 } DT.western { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 10pt } H4 { color: #000000 } A:link { color: #0085c0 } A:visited { color: #800080 } --> </STYLE> </HEAD> <BODY LANG="en-US" TEXT="#000000" LINK="#0085c0" VLINK="#800080" BGCOLOR="#ffffff" DIR="LTR"> <TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=2 STYLE="page-break-before: always"> <TR> <TD BGCOLOR="#52799e"> <P><IMG SRC="../images/right_triangle.png" NAME="Graphic2" ALT=">" ALIGN=BOTTOM WIDTH=15 HEIGHT=14 BORDER=0> <FONT COLOR="#ffffff"><FONT FACE="Helvetica, Arial"><B>GraphicsMagick Motion Picture Features</B></FONT></FONT></P> </TD> </TR> </TABLE> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri">Features have been added to <A HREF="http://sourceforge.net/project/showfiles.php?group_id=73485" TARGET="_top">GraphicsMagick 1.2</A> to make it more suitable for processing images used by the motion picture (film and high-definition) industry. In particular, industrial strength support for <A HREF="http://www.smpte.org/" TARGET="_top">SMPTE</A> DPX Version 2.0 (SMPTE 268M-2003) has been added for GraphicsMagick 1.2. Legacy 10-bit Kodak Cineon is also supported. A new logarithmic RGB space based on Kodak's Cineon log definition has been added to support images which use a logarithmic density encoding (with range of 0 to 2.048) according to Kodak specifications. Support for legacy Kodak 4.5 Cineon format has been improved.</FONT></P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri">GraphicsMagick's DPX support has already been put to use in the industry. It was used to perform 16-bit TIFF to DPX conversion for Christopher Reeve's last film "<A HREF="http://www.everyonesherodvd.com/flash/ehero.html" TARGET="_top">Everyone's Hero</A>". While this may not be Christopher Reeve's most memorable work, the film's images turned out great, and the kids are sure to enjoy the film.</FONT></P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri">The modern motion picture industry usually shoots on film and then uses a machine known as a “datacine” (e.g. <A HREF="http://www.grassvalley.com/products/film/spirit_4k/" TARGET="_top">Spirit 4K DataCine</A> or </FONT>Cintel DSX) <FONT FACE="Verdana, Arial, Helvetica, sans-seri">or a “scanner” (e.g. <A HREF="http://www.filmlight.ltd.uk/" TARGET="_top">Northlight Scanner</A> or <A HREF="http://www.lasergraphics.com/">Lasergraphics</A> Director) to convert each film image into an individual image file. An alternative to this is to use a high definition CCD camera such as the <A HREF="http://www.grassvalley.com/products/cameras/viper/" TARGET="_top">Grass Valley Viper</A> or the <A HREF="http://www.dalsa.com/dc/4K_products/origin_main.asp" TARGET="_top">DALSA Origin</A> to capture images to uncompressed files directly. A rather inferior approach is to use a video high definition compressed format like HDCAM and convert each frame to a file for processing.</FONT></P> <P CLASS="western">Images scanned from film are usually in either a log colorspace similar to Cineon Log (10 bits per sample is most common), or in a linear format (16 bits per sample is common). Some cameras (such as the Thompson Viper) use log encoding similar to Cineon Log. Log encoding has the advantage that fewer bits are necessary to cover the extended dynamic range of film, and that the log encoding approximates the density characteristics of film (approximately linear when log encoded).</P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri">While there is some continued use of the legacy</FONT> Kodak Cineon <FONT FACE="Verdana, Arial, Helvetica, sans-seri">format due to existing equipment and software, the standard image file format for motion picture frames is <A HREF="http://www.smpte.org/" TARGET="_top">SMPTE</A> DPX (SMPTE 268M-2003). This format is somewhat similar to the Kodak Cineon format, but has the advantage that it is an industry standard rather than a vendor standard. DPX files are practically always uncompressed. The design of DPX places header content at fixed offsets, and the image raster data offsets may be computed, so DPX files may be read or updated without rewriting the entire file.</FONT></P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri">Film images are usually captured at “2K” resolution (</FONT>82 pixels/mm)<FONT FACE="Verdana, Arial, Helvetica, sans-seri">, “4K” resolution (</FONT>164 pixels/mm)<FONT FACE="Verdana, Arial, Helvetica, sans-seri">, or even “8K” resolution (328 pixels/mm</FONT>)<FONT FACE="Verdana, Arial, Helvetica, sans-seri">, where the actual resolution values approximate the horizontal dimension of the image. A table of <A HREF="http://www.surrealroad.com/digital/index.php/archives/2005/standard-data-resolutions/" TARGET="_top">typical pixel resolutions for various film sizes</A> may be found on the <A HREF="http://www.digitalintermediates.org/" TARGET="_top">Digital Intermediates</A> site. File sizes may be quite large and range in size from 8MB to as much as 180MB. The common 10-bit “2K” format consumes 12MB of disk while a 10-bit “4K” scan consumes 50MB of disk. A typical movie has an average of 144K frames (at 24 frames per second) so just one movie consumes terabytes of storage. Businesses which specialize in handling digital intermediates may have available on-line storage ranging from several tens of terabytes to several hundred terabytes. While “2K” has been the standard working resolution due to storage requirements and processing time, recently there is a trend to scanning at “4K” resolution since most experts say that this is the resolution necessary to capture the full resolution of a 35mm frame (but some claim more!). IMAX film (10X the area of 35mm film!) can likely support “21K” resolution once someone builds a machine capable of doing so but is currently scanned at “8K” resolution. Some shops scan at “4K” but then reduce the image to “2K” as the working format so that the full resolution is available for later use, but the processing of the feature may be done on a normal “2K” schedule. An alternative is to do the work at “2K” but record a record of all the changes so that the changes may be re-played to obtain similar results at “4K”.</FONT></P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=2>The end result of the effort of encoding motion picture images to digital image files is to have a digital master which does not degrade over time and which has captured the maximum available information from the original film print. This digital master may be targeted toward producing film prints for showing in a theater, used to create DVDs, used as a master for “digital cinema” for viewing in suitably equipped theaters, or used to support television broadcasts.</FONT></FONT></P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=2>Processing film images is a specialty business. Many business exist which offer specialized software and hardware to process film images. Common tasks are “color grading” (adjusting color for a correct film print), dust busting, and compositing. While GraphicsMagick could (with some effort) be used to accomplish many of these things it can never expect to compete in these specialized areas. GraphicsMagick lacks the high-quality graphical user interface necessary for a colorist or artist to interact with a sequence of images. GraphicsMagick lacks the experienced and dedicated team necessary to assure the desired results with particular media.</FONT></FONT></P> <P CLASS="western"><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=2>The strength of GraphicsMagick versus specialized proprietary software are its cost (absolutely free!), open source availability (user is able to fix software flaws or tailor software to meet specific needs), general purpose image processing capabilities, deep image capabilities (up to 32-bits per sample), excellent performance, platform independence, lack of encumbering usage licenses, and robust implementation. Examples of areas where GraphicsMagick may be used are:</FONT></FONT></P> <P CLASS="western" STYLE="margin-left: 0.79in"><FONT SIZE=2><FONT FACE="Verdana, Arial, Helvetica, sans-seri">View the image on a display.<BR>Scaling (for example, “4K” to “2K” or 1920x1080 HD with excellent quality)<BR>Cropping<BR>Rotation<BR>Filtering<BR>ICC ICM profile-based color management and tran</FONT>sformations<BR>Gamma adjustment<BR>Color adjustment<BR>Conversion to grayscale<BR>Text annotations<BR>Compositions<BR>Drawing on images (for example drawing markers on image)<BR>Conversion to and from other formats (e.g. Kodak Cineon, TIFF, JPEG, SGI, Postscript, PNG, and PNM)</FONT></P> <P CLASS="western"><FONT SIZE=2>GraphicsMagick performs well as compared with other software. Since it is free and portable, it may be installed on any available system with no license fees. For example, if a studio has a computing cluster of several hundred Linux, SGI IRIX, Solaris, FreeBSD, or Mac OS X systems, then GraphicsMagick may be installed across all systems and used for any desired purpose.</FONT></P> <P CLASS="western"><FONT SIZE=2>GraphicsMagick's DPX file format support is very comprehensive. It goes beyond the DPX format support in other applications by striving to implement the complete DPX specification rather than just a few commonly used sub-formats. The capabilities of GraphicsMagick's DPX support are as follows:</FONT></P> <P CLASS="western"><FONT SIZE=2><B>Supported DPX features:</B></FONT></P> <UL> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Anything which can be read, can also be written.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">All DPX header information (including the user specific area) are stored as image attributes and restored when the image is written.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Image source header information is updated appropriately.</P> </UL> <P CLASS="western"><FONT SIZE=2><B>Colorspaces</B>:</FONT></P> <UL> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Linear RGB</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Cineon Log RGB (default density range = 2.048)</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Grayscale (Luma)</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Rec. 601 and Rec. 709 YCbCr (4:4:4 and 4:2:2). Below-black and above-white values are clipped.</P> </UL> <P CLASS="western"><FONT SIZE=2><B>Storage</B>:</FONT></P> <UL> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Bits per sample of 1, 8, 10, 12, and 16.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Packed, or fill type A or B for 10/12 bits.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">All RGB-oriented element types (R, G, B, A, RGB, RGBA, ABGR).</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">YCbCr</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Planar (multi-element) storage fully supported.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Alpha may be stored in a separate element.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Big and little endian storage.</P> </UL> <P CLASS="western"><FONT SIZE=2><B>Yet to be supported:</B></FONT></P> <UL> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Composite video.</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Floating point formats (32 and 64 bits)</P> <LI><P CLASS="western" STYLE="margin-bottom: 0.08in">Depth channel (not supportable within GraphicsMagick).</P> </UL> <P CLASS="western"><FONT SIZE=2>The software is written efficiently so the performance when reading and writing files is limited by the performance of the file I/O subsystem. The software is designed to avoid seeking while reading and writing so that files may be read and written over pipes, or via a user provided file descriptor.</FONT></P> <H3 CLASS="western">GraphicsMagick In Use</H3> <H4>Image Resize</H4> <P CLASS="western"><FONT SIZE=2>GraphicsMagick is easy to use. The following is an example of scaling a “4K” 16 bit scan to a “2K” “Academy” 10 bit image:</FONT></P> <PRE STYLE="margin-bottom: 0.2in"> gm convert 4k.dpx -resize 1828x1556 -depth 10 2k.dpx</PRE><P CLASS="western"> <FONT SIZE=2>The above example uses the default resizing filters which are optimized for quality, but take longer than some other filters. The “box” resize filter provides reasonably good scaling in a reasonable amount of time:</FONT></P> <PRE STYLE="margin-bottom: 0.2in"> gm convert 4k.dpx -filter box -resize 1828x1556 -depth 10 2k.dpx</PRE><P CLASS="western"> The above example command takes about 5 seconds (on an Apple 2.5GHz G5 PowerMac or Intel 2.4GHz Xeon) to down-convert from a 131MB “5K” (5232x4376) original 16-bit scan from a <A HREF="http://www.filmlight.ltd.uk/" TARGET="_top">NorthLight scanner</A> to a 11MB “2K” 10-bit working image. Operations on more typical “2K” images take on the order of half a second.</P> <H4>Annotate Image</H4> <P CLASS="western">The following example shows how GraphicsMagick's resize capability may be combined with its powerful drawing capability to take a full size source image and produce a smaller (720x576) version which includes the image filename and timecode at the top of the image, and a logo “bug” image in the bottom right corner:</P> <PRE>gm convert infile.dpx -resize “720x576!” \ -draw 'fill "white";text-undercolor "Blue";font "Helvetica";font-size 18;text 10,20 "%f (%[DPX:tv.time.code])";image atop 500,400 0,0 "gm-125x80t.png"' \ outfile.dpx</PRE><P CLASS="western"> As may be seen, the argument to -draw can become extremely long, so to make things easy, the drawing commands may be placed in a simple text file and passed by reference to the draw comand:</P> <P CLASS="western">First lets check what we edited into our drawing command file:</P> <PRE> % cat drawcmd.txt fill "white" text-undercolor "Blue" font "Helvetica" font-size 18 text 10,20 "%f (%[DPX:tv.time.code])" image atop 500,400 "0,0 "gm-125x80t.png"</PRE><P CLASS="western"> and now we can apply it by passing the filename prefixed with a '@' to the -draw command:</P> <PRE STYLE="margin-bottom: 0.2in"> gm convert infile.dpx -resize “720x576!” -draw “@drawcmd.txt” outfile.dpx</PRE><P CLASS="western"> The “0,0” in the image composition command argument says to use the image as is. If the composited image should be automatically resized, then simply replace the “0,0” with the desired size.</P> <P CLASS="western">There are a number of powerful scripting environments for GraphicsMagick. One of these is <A HREF="http://rmagick.rubyforge.org/" TARGET="_top">RMagick</A> (Ruby language interface to GraphicsMagick). In Ruby, the same effect may be obtained via a script that looks like:</P> <PRE> #! /usr/local/bin/ruby -w require 'RMagick' include Magick img = Image.read('infile.dpx')[0] frog = Image.read('gm-125x80t.png')[0] gc = Draw.new gc.fill('white') gc.text_undercolor("Blue") gc.font("Helvetica") gc.font_size(18) gc.text(10, 20, "%f (%[DPX:tv.time.code])") gc.composite(500, 400, 0, 0, frog, AtopCompositeOp) gc.draw(img) img.write('outfile.dpx')</PRE><P CLASS="western"> In addition to Ruby, there are scripting interfaces for Perl, Python, Tcl, and Ch (C-like scripting language).</P> <H4>Colorspace Transformation</H4> <P CLASS="western">To convert an RGB file to a 4:2:2 YCbCr file in Rec 709 space:</P> <PRE STYLE="margin-bottom: 0.2in"> gm convert 2k.dpx -depth 10 -colorspace Rec709YCbCr -sampling-factor 4:2:2 2k-ycbcr.dpx</PRE><H4> Modifying An Image In-Place</H4> <P CLASS="western">Besides <EM>convert</EM>, which converts from one file to another, there is <EM>mogrify</EM> which transforms the file in place. A temporary file is used (if necessary) to ensure that the existing image file is not damaged if something goes wrong (e.g., not enough disk space). Note that unlike some applications supporting DPX/Cineon, when a file is modifed “in-place” , it is completely re-written. While GraphicsMagick makes every attempt to preserve header information, some previously existing features of the file (such as the offset to the pixel data) may change.</P> <P CLASS="western">A typical mogrify command is</P> <PRE STYLE="margin-bottom: 0.2in"> gm mogrify -resize 1828x1556 -depth 10 file-0001.dpx file-0002.dpx</PRE><H3 CLASS="western"> Multiple files may be specified on the command line so the same command may process hundreds of files in one invocation.</H3> <P CLASS="western">Unix users can use the <EM>find</EM> and <EM>xargs</EM> programs to perform operations on any number of files:</P> <PRE STYLE="margin-bottom: 0.2in"> find /assets/001 -name '*.dpx' -print | xargs gm mogrify -resize 1828x1556 -depth 10</PRE><P CLASS="western"> Xargs works by pasting as many file names as possible on the end of the command provided to it.</P> <P CLASS="western">The GNU version of <EM>xargs</EM> provides an added benefit. It is able to run several commands in the background. This means that if your system has multiple CPUs, it can take advantage of all the CPUs while still using one command:</P> <PRE STYLE="margin-bottom: 0.2in"> find /assets/001 -name '*.dpx' -print | xargs --max-procs 3 --max-args 25 gm mogrify -resize 1828x1556 -depth 10</PRE><P CLASS="western"> The mogrify command supports the -output-directory option to sent files to a different directory than the input files. This allows processing a large number of files without overwriting the input files:</P> <PRE> mkdir dest cd source gm mogrify -output-directory ../dest -resize 1828x1556 -depth 10 “*.dpx”</PRE><P CLASS="western"> Note that the entire input file path specification is preserved when composing the output path so that the input file path is simply appended to the output directory path. Also, unless the -create-directories option is added, the user is responsible for creating any necessary destination directories. As an example of the path composition algorithm, if the input file name is specified as <I>source/file.dpx</I> and the output directory is specified as <I>dest</I>, then the output file path will be <I>dest/source/file.dpx</I>.</P> <P CLASS="western">Here is an incantation which recursively processes all DPX files under <I>source</I> and sends the result to a similar directory tree under <I>dest</I>.</P> <PRE> mkdir dest cd source find . name '*.dpx' -print | xargs gm mogrify -output-directory ../dest \ -create-directories -resize 1828x1556 -depth 10</PRE><H4> Creating A Contact Sheet</H4> <P CLASS="western">GraphicsMagick may be used to create a contact sheet (grid of thumbnails with name and size) by using the “VID” pseudoformat which accepts a wildcarded argument of files (protected by quotes!) to read. The output files are buffered while files are being read so there is a practical limit to the number of files which may be processed at once. To output to a Postscript file:</P> <PRE STYLE="margin-bottom: 0.2in"> gm convert "vid:*.dpx" "contact-sheet.ps"</PRE><P CLASS="western"> or to a PDF file:</P> <PRE STYLE="margin-bottom: 0.2in"> gm convert "vid:*.dpx" "contact-sheet.pdf"</PRE><P CLASS="western"> or to a sequence of JPEG files ranging from contact-sheet-000.jpg to contact-sheet-999.jpg:</P> <PRE STYLE="margin-bottom: 0.2in"> gm convert "vid:*.dpx" "contact-sheet-%03d.jpg"</PRE><P CLASS="western"> or to a MIFF file which may be used to interactively browse the original files using 'gm display':</P> <PRE STYLE="margin-bottom: 0.2in"> gm convert "vid:*.dpx" "contact-sheet.miff"</PRE><H4> Animating A Sequence</H4> <P CLASS="western">GraphicsMagick may be used to animate an image sequence on an X11 display. Frames are buffered in memory (pre-loaded into the X11 server) so the number of frames which may be animated at once is limited. GraphicsMagick has been used to animate 1080P (1920x1080) images at 24 frames per second with at least 300 frames in the sequence.More frames may be buffered on 64-bit systems. Many more frames may be animated by preparing a reduced set of frames in advance.</P> <P CLASS="western">To visualize an animation at 24 frames per second (delay (1/24)*100) use</P> <PRE STYLE="margin-bottom: 0.2in"> gm animate -delay 4.17 “Frame_*.dpx”</PRE><P CLASS="western"> In order to obtain a preview of a larger sequence, and if the frames are numbered, a broader span of time may be animated by selecting every 10<SUP>th</SUP> frame (terminating with zero) to animate at 2.4 frames per second:</P> <PRE STYLE="margin-bottom: 0.2in"> gm animate -delay 41.7 “Frame_*0.dpx”</PRE><H4> Displaying One Image Frame</H4> <P CLASS="western">An image frame may be displayed on an X11 server using 'gm display'. By default the name of the image file is displayed in the title bar. By specifying the format of the title, other useful information such as the time code (see the DPX Attributes section for more details) may be included in the window title:</P> <PRE STYLE="margin-bottom: 0.2in"> gm display -title '%f (%[DPX:tv.time.code])' foo.dpx</PRE><H4> Viewing A Sequence</H4> <P CLASS="western">A sequence of images may be displayed on an X11 server using 'gm display'. Unlike 'gm animate' there are no arbitrary limits when displaying a sequence this way. Unlike 'gm animate' the inter-frame delay can not be set to less than a second (100 ticks is one second).</P> <PRE STYLE="margin-bottom: 0.2in"> gm display +progress -delay 100 “Frame_*.dpx”</PRE><H3 CLASS="western"> DPX options</H3> <P CLASS="western">The following options are particularly useful when dealing with DPX files.</P> <DL> <DT CLASS="western">-colorspace {CineonLog|RGB|Gray|Rec601Luma|Rec709Luma|Rec601YCbCr|Rec709YCbCr}</DT><DD CLASS="western"> Specifies the colorspace to be used when saving the DPX file. CineonLog selects log encoding according to Kodak Cineon specifications. RGB selects linear RGB encoding. Gray selects linear gray encoding similar to RGB, but with a single channel. Rec601Luma requests that RGB is converted to a gray image using Rec601 Luma. Rec709Luma requests that RGB is converted to a gray image using Rec709Luma. Rec601YCbCr requests that the image is saved as YCbCr according to Rec601 (SDTV) specifications. Rec709CbCr requests that the image is saved as YCbCr according to Rec709 (HDTV) specifications.</DD><DT CLASS="western"> -endian {lsb|msb}</DT><DD CLASS="western"> Specifies the endian order to use when writing the DPX file. GraphicsMagick writes big-endian DPX files by default since they are the most portable. Other implementations may use the native order of the host CPU (e.g. little-endian when using an Intel 'x86 CPU).</DD><DT CLASS="western"> -depth <value></DT><DD CLASS="western"> Specifies the number of bits to preserve in a color sample. By default the output file is written with the same number of bits as the input file. For example, if the input file is 16 bits, it may be reduced to 10 bits via '-depth 10'.</DD><DT CLASS="western"> -define dpx:bits-per-sample=<value></DT><DD CLASS="western"> If the dpx:bits-per-sample key is defined, GraphicsMagick will write DPX images with the specified bits per sample, overriding any existing depth value. If this option is not specified, then the value is based on the existing image depth value from the original image file. The DPX standard supports bits per sample values of 1, 8, 10, 12, and 16. Many DPX readers demand a sample size of 10 bits with type A padding (see below).</DD><DT CLASS="western"> -define dpx:colorspace={rgb|cineonlog}</DT><DD CLASS="western"> Use the dpx:colorspace option when reading a DPX file to specify the colorspace the DPX file uses. This overrides the colorspace type implied by the DPX header (if any). Currently files with the transfer characteristic <I>Printing Density</I> are assumed to be log encoded density while files marked as <I>Linear</I> are assumed to be linear. Hint: use '-define dpx:colorspace=rgb' in order to avoid the log to linear transformation for DPX files which use Printing Density.</DD><DT CLASS="western"> -define dpx:packing-method={packed|a|b|lsbpad|msbpad}</DT><DD CLASS="western"> DPX samples may be output within 32-bit words. They may be tightly packed end-to-end within the words ("packed"), padded with null bits to the right of the sample ("a" or "lsbpad”), or padded with null bits to the left of the sample ("b" or "msbpad"). This option only has an effect for sample sizes of 10 or 12 bits. If samples are not packed, the DPX standard recommends type A padding. Many DPX readers demand a sample size of 10 bits with type A padding.</DD><DT CLASS="western"> -define dpx:pixel-endian={lsb|msb}</DT><DD CLASS="western"> DPX pixels should use the endian order that the DPX header specifies. Sometimes there is a mis-match and the pixels use a different endian order than the file header specifies. For example, the file header may specify little endian, but the pixels are in big-endian order. To work around that use -define dpx-pixel-endian=msb when reading the file. Likewise, this option may be used to intentionally write the pixels using a different order than the header. Files obtained from the <A HREF="http://www.digitalpreservation.gov/" TARGET="_top">Library Of Congress</A> use big-endian 10-bit packed pixels in a file marked as little-endian so this option must be used to read such files correctly.</DD><DT CLASS="western"> -define dpx:swap-samples={true|false}</DT><DD CLASS="western"> GraphicsMagick strives to adhere to the DPX standard but certain aspects of the standard can be quite confusing. As a result, some 10-bit DPX files have Red and Blue interchanged, or Cb and Cr interchanged due to an different interpretation of the standard, or getting the wires crossed. The swap-samples option may be supplied when reading or writing in order to read or write using the necessary sample order.</DD><DT CLASS="western"> -interlace plane</DT><DD CLASS="western"> By default, samples are stored contiguously in a single element when possible. Specifying '-interlace plane' causes each sample type (e.g. 'red') to be stored in its own image element. Planar storage is fully supported for grayscale (with alpha) and RGB. For YCbCr, chroma must be 4:2:2 subsampled in order to use planar storage. While planar storage offers a number of benefits, it seems that very few DPX-supporting applications support it.</DD><DT CLASS="western"> -sampling-factor 4:2:2</DT><DD CLASS="western"> Select 4:2:2 subsampling when saving an image in YCbCr format. Subsampling is handled via a general-purpose image resize algorithm (lanczos) rather than a dedicated filter so subsampling is slow (but good).</DD><DT CLASS="western"> -set reference-white <value></DT><DD CLASS="western"> Set the 90% white card level (default 685) for Cineon Log.</DD><DT CLASS="western"> -set reference-black <value></DT><DD CLASS="western"> Set the 1% black card level (default 95) for Cineon Log.</DD><DT CLASS="western"> -set display-gamma <value></DT><DD CLASS="western"> Set the display gamma (default 1.7) for Cineon Log.</DD><DT CLASS="western"> -set film-gamma <value></DT><DD CLASS="western"> Set the film gamma (default 0.6) for Cineon Log.</DD><DT CLASS="western"> -set soft-clip-offset <value></DT><DD CLASS="western" STYLE="margin-bottom: 0.2in"> Set the soft clip offset (default 0) when converting to “computer” RGB from Cineon Log.</DD></DL> <H3 CLASS="western"> DPX Attributes</H3> <UL> <LI><P CLASS="western">GraphicsMagick provides almost full access to DPX header attributes. DPX header attributes are shown in the output of '<KBD>gm identify -verbose</KBD>' and may be set using the -define syntax (e.g. '<KBD>-define dpx:mp.frame.position=2000</KBD>') on the command line in order to add a value, or override an existing value. The attributes in the list below may be viewed or updated. The names are similar to the attribute descriptions from the DPX standard.</P> </UL> <DL> <DD CLASS="western"><VAR>dpx:file.copyright</VAR></DD><DD CLASS="western"> <VAR>dpx:file.creation.datetime</VAR></DD><DD CLASS="western"> <VAR>dpx:file.creator</VAR></DD><DD CLASS="western"> <VAR>dpx:file.encryption.key</VAR></DD><DD CLASS="western"> <VAR>dpx:file.filename</VAR></DD><DD CLASS="western"> <VAR>dpx:file.project.name</VAR></DD><DD CLASS="western"> <VAR>dpx:file.version</VAR></DD><DD CLASS="western"> <VAR>dpx:image.orientation</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.count</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.film.manufacturer.id</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.film.type</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.format</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.frame.id</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.frame.position</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.frame.rate</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.held.count</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.perfs.offset</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.prefix</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.sequence.length</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.shutter.angle</VAR></DD><DD CLASS="western"> <VAR>dpx:mp.slate.info</VAR></DD><DD CLASS="western"> <VAR>dpx:source.aspect.ratio.horizontal</VAR></DD><DD CLASS="western"> <VAR>dpx:source.aspect.ratio.vertical</VAR></DD><DD CLASS="western"> <VAR>dpx:source.border.validity.bottom</VAR></DD><DD CLASS="western"> <VAR>dpx:source.border.validity.left</VAR></DD><DD CLASS="western"> <VAR>dpx:source.border.validity.right</VAR></DD><DD CLASS="western"> <VAR>dpx:source.border.validity.top</VAR></DD><DD CLASS="western"> <VAR>dpx:source.creation.datetime</VAR></DD><DD CLASS="western"> <VAR>dpx:source.device.name</VAR></DD><DD CLASS="western"> <VAR>dpx:source.device.serialnumber</VAR></DD><DD CLASS="western"> <VAR>dpx:source.filename</VAR></DD><DD CLASS="western"> <VAR>dpx:source.scanned.size.x</VAR></DD><DD CLASS="western"> <VAR>dpx:source.scanned.size.y</VAR></DD><DD CLASS="western"> <VAR>dpx:source.x-center</VAR></DD><DD CLASS="western"> <VAR>dpx:source.x-offset</VAR></DD><DD CLASS="western"> <VAR>dpx:source.x-original-size</VAR></DD><DD CLASS="western"> <VAR>dpx:source.y-center</VAR></DD><DD CLASS="western"> <VAR>dpx:source.y-offset</VAR></DD><DD CLASS="western"> <VAR>dpx:source.y-original-size</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.black.gain</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.black.level</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.breakpoint</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.field.number</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.gama</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.horizontal.sampling.rate</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.integration.time</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.interlace</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.sync.time</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.temporal.sampling.rate</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.time.code</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.user.bits</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.video.signal</VAR></DD><DD CLASS="western"> <VAR>dpx:tv.white.level</VAR></DD><DD CLASS="western" STYLE="margin-bottom: 0.2in"> <VAR>dpx:user.data.id</VAR></DD></DL> <P CLASS="western"> Specific header values from a DPX file may be displayed quickly using a command similar to:</P> <PRE STYLE="margin-bottom: 0.2in"> gm identify -format '%[DPX:tv.time.code]' foo.dpx</PRE><P CLASS="western"> Use</P> <PRE STYLE="margin-bottom: 0.2in"> gm identify -format '%[dpx:*]' foo.dpx</PRE><P CLASS="western"> to list all DPX header attributes.</P> <HR> <P CLASS="western" ALIGN=CENTER><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><A HREF="Copyright.html">Copyright</A> </FONT><FONT FACE="Abadi Mt Condensed Extra Bold">©</FONT> <FONT FACE="Verdana, Arial, Helvetica, sans-seri">GraphicsMagick Group 2005 - 2008</FONT></P> </BODY> </HTML>