LinuxCommandLibrary

inkscape

Create and edit vector graphics

TLDR

Open an SVG file in the Inkscape GUI

$ inkscape [path/to/file.svg]
copy

Export an SVG file into a bitmap with the default format (PNG) and the default resolution (96 DPI)
$ inkscape [path/to/file.svg] [[-o|--export-filename]] [path/to/filename.png]
copy

Export an SVG file into a bitmap of 600x400 pixels (aspect ratio distortion may occur)
$ inkscape [path/to/file.svg] [[-o|--export-filename]] [path/to/filename.png] [[-w|--export-width]] [600] [[-h|--export-height]] [400]
copy

Export the drawing (bounding box of all objects) of an SVG file into a bitmap
$ inkscape [path/to/file.svg] [[-o|--export-filename]] [path/to/filename.png] [[-D|--export-area-drawing]]
copy

Export a single object, given its ID, into a bitmap
$ inkscape [path/to/file.svg] [[-i|--export-id]] [id] [[-o|--export-filename]] [object.png]
copy

Export an SVG document to PDF, converting all texts to paths
$ inkscape [path/to/file.svg] [[-o|--export-filename]] [path/to/filename.pdf] [[-T|--export-text-to-path]]
copy

Duplicate the object with id="path123", rotate the duplicate 90 degrees, save the file, and quit Inkscape
$ inkscape [path/to/file.svg] --select=path123 --verb="[EditDuplicate;ObjectRotate90;FileSave;FileQuit]"
copy

SYNOPSIS

inkscape [options] [filename ...]

PARAMETERS

--help
    Show help options.

--version
    Show Inkscape version information.

--without-gui
    Run Inkscape without the graphical user interface. (for command-line processing).

--query-all
    List all object IDs in the SVG file.

--query-id=id
    Query an object identified by id.

--query-width
    Query the width of the SVG document.

--query-height
    Query the height of the SVG document.

--query-x
    Query the X position of the SVG document.

--query-y
    Query the Y position of the SVG document.

--export-area=x0:y0:x1:y1
    Specify the area to export (x0, y0 are top-left corner coordinates; x1, y1 are bottom-right).

--export-background=color
    Set the background color for export.

--export-background-opacity=opacity
    Set the background opacity for export.

--export-dpi=dpi
    Set the DPI (dots per inch) for export.

--export-filename=filename
    Specify the output filename for export.

--export-format=format
    Specify the export format.

--export-pdf
    Export to PDF format.

--export-png
    Export to PNG format.

--export-ps
    Export to PostScript format.

--export-svg
    Export to SVG format.

--export-plain-svg
    Export to plain SVG format.

--export-emf
    Export to EMF format.

--export-width=width
    Specify the export width in pixels.

--export-height=height
    Specify the export height in pixels.

[filename]
    Open a specified SVG file.

DESCRIPTION

Inkscape is a powerful, open-source vector graphics editor. It's similar to Adobe Illustrator or CorelDRAW, allowing users to create and edit scalable vector graphics (SVG) images. Unlike raster graphics, vector graphics are based on mathematical equations, meaning they can be scaled infinitely without losing quality. This makes Inkscape ideal for creating logos, illustrations, diagrams, charts, and other graphics that need to be resized for different purposes.

Inkscape provides a wide range of tools for drawing shapes, paths, and text, as well as advanced features like gradients, patterns, and filters. It supports various file formats, including SVG, PNG, PDF, EPS, and more. It's a versatile tool for both professional designers and hobbyists. Inkscape is cross-platform and runs on Linux, Windows, and macOS operating systems. The command line interface allows automation and scripting.

CAVEATS

Command-line usage requires familiarity with Inkscape's object naming conventions and SVG structure. Exporting complex documents via the command line might require experimentation to achieve desired results.

EXAMPLES

Export an SVG file to PNG:
inkscape --export-png=output.png input.svg
Export a specific area:
inkscape --export-area=10:20:100:150 --export-png=output.png input.svg
Query the width of an SVG:
inkscape --query-width input.svg

HISTORY

Inkscape was forked from the Sodipodi project in 2003. It aimed to implement full SVG support and improve usability. Over time, it has become a mature and widely used open-source vector graphics editor, replacing Sodipodi completely. Its command line interface has been continuously improved for scripting and automation tasks.

SEE ALSO

convert(1), pdfinfo(1)

Copied to clipboard