Ichabod runs as a single-threaded process handling one request at a time. In order to support parallel processing, consider running multiple copies behind a proxy.
Command line options
The following command line options control various aspects of the rendering engine:
The port to listen to for requests.
Debug output level. Specifying levels greater than zero will print out processing details to the console.
Debug output level for rendering engine (qt webkit).
Debug output level for image rasterization.
Number of milliseconds before considering a response to be slow. This could happen for several reasons (e.g., waiting on an external asset request). Once a slow response is detected, debug output is turned all the way up to aid in debugging.
Quantization method to use when downsampling images for animated gif output. By default, this is
MEDIANCUT, which is a high quality method for reducing the number of colors in an image. Other options are:
THRESHOLDFast and ugly color mapping
DIFFUSEAlso fast, less ugly
ORDEREDVery fast, very ugly
MEDIANCUT- Acceptable speed, high quality
MEDIANCUT_FLOYD- A modified version of
MEDIANCUTusing a different dithering algorithm.
Output the version and quit.
Optional statsd host.
Optional statsd port.
Optional statsd namespace when sending activity.
Ichabod only accepts requests formatted as a JSON object. Here are the required and optional fields which are accepted:
png. Also accepts
htmlHTML source code to render and rasterize. Also see
urlOptional. If no
htmlis specified, the HTML from this URL will be used.
outputPath and filename to write the final image to. This must be accessible to the ichabod process.
transparentOptional. Boolean value which can enable transparent background. Default is 1. Typically set to 0 for animated output.
widthWidth of the virtual screen used to render the HTML.
heightOptional. Height of the virtual screen used to render the HTML. Default is -1, which will dynamically grow the height according to the HTML being rendered..
crop_xOptional. X coordinate of final crop rectangle. Cropping takes place as the final step of rasterization.
crop_yOptional. Y coordinate of final crop rectangle. Cropping takes place as the final step of rasterization.
crop_wOptional. Width of final crop rectangle. Cropping takes place as the final step of rasterization.
crop_hOptional. Height of final crop rectangle. Cropping takes place as the final step of rasterization.
smart_widthOptional. Dynamically grow the width according to HTML being rendered. Default is 1.
css- Optional. Additional CSS to apply after the HTML is loaded.
selectorOptional. CSS selector to rasterize instead of the entire HTML body.
load_timeoutOptional. Maximum time allowed for a document to load before giving up. Typically used with
enable_statsdOptional. Send activity to statsd.
statsd_nsOptional. Namespace to use when communicating with statsd.
After processing a request, a response is returned to the client as a JSON string. The following fields are returned:
conversionBoolean indicating whether a successful rasterization took place
convert_elapsedElapsed time for image rasterization
pathOutput path of the rendered image. Will correspond to the request
outputfield when successful.
run_elapsedElapsed time for everything: handling the request, rendering the HTML and rastering the image.
After ichabod loads the HTML (either specified directly in the request
request is executed. In order to trigger rasterization, an internal
ichabod) can be used. This
object has several useful methods:
setTransparentTakes a boolean argument indicating whether or not background transparency should be used when rendering.
setQualitySet the quality of the render as an integer from 1 to 100. By default, this is 50 which is a good tradeoff between speed and quality.
setScreenSet the dimensions of the virtual screen for rasterization. Specify x, y, width and height as integers.
setFormatSet the format of the rasterization output. Use
setLoopingTakes a boolean to enable or disable looping for animated output.
snapshotPageRasterizes the entire HTML into memory. This method can be called multiple times. When writing animated files, you can also specify a delay (in milliseconds). When writing animated output, all rasterized images are compiled into a gif. When writing a static image as output, only the last rasterized image is used.
snapshotElementsRasterizes one or more CSS identifiers within the HTML. Otherwise, similar to
saveToOutputSaves the rasterized image(s) to disk. Once this method is called, no more rasterization can take place.
setQuantizeMethodChanges the quanitization method for downsampling images when writing animated gifs.
setSelectorSets the full CSS path to an element, which limits the rasterization to that area of the page.
setCssSpecifies additional CSS which is applied immediately to the page.
setCropRectSpecifies the absolute x, y, width and height of a cropping rectangle. This crop takes place as the last step of rasterization.
setSmartWidthTakes a boolean argument to enable or disable using smart width calculation before rasterizing.