Create a PNG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.

*New in Pygments 0.10.*

Additional options accepted:


An image format to output to that is recognised by PIL, these include:

* "PNG" (default)
* "JPEG"
* "BMP"
* "GIF"


The extra spacing (in pixels) between each line of text.

Default: 2


The font name to be used as the base font from which others, such as
bold and italic fonts will be generated.  This really should be a
monospace font to look sane.

Default: "Bitstream Vera Sans Mono"


The font size in points to be used.

Default: 14


The padding, in pixels to be used at each edge of the resulting image.

Default: 10


Whether line numbers should be shown: True/False

Default: True


The line number of the first line.

Default: 1


The step used when printing line numbers.

Default: 1


The background colour (in "#123456" format) of the line number bar, or
None to use the style background color.

Default: "#eed"


The text color of the line numbers (in "#123456"-like format).

Default: "#886"


The number of columns of line numbers allowable in the line number

Default: 2


Whether line numbers will be bold: True/False

Default: False


Whether line numbers will be italicized: True/False

Default: False


Whether a line will be drawn between the line number area and the
source code area: True/False

Default: True


The horizontal padding (in pixels) between the line number margin, and
the source code area.

Default: 6


Specify a list of lines to be highlighted.  *New in Pygments 1.2.*

Default: empty list


Specify the color for highlighting lines.  *New in Pygments 1.2.*

Default: highlight color of the selected style

ImageFormatter is referenced in 0 repositories