All Projects → wader → inkmake

wader / inkmake

Licence: other
Makefile inspired export from SVG files using Inkscape as backend with some added smartness.

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects
Dockerfile
14818 projects
Roff
2310 projects

Projects that are alternatives of or similar to inkmake

Sketchup Stl
A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
Stars: ✭ 214 (+919.05%)
Mutual labels:  export
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (+14.29%)
Mutual labels:  export
cassandra-exporter
Simple Tool to Export / Import Cassandra Tables into JSON
Stars: ✭ 44 (+109.52%)
Mutual labels:  export
Portphp
Data import/export framework for PHP
Stars: ✭ 225 (+971.43%)
Mutual labels:  export
vue-datagrid
Spreadsheet data grid component. Handles enormous data processing.
Stars: ✭ 171 (+714.29%)
Mutual labels:  export
rodf
ODF generation library for Ruby
Stars: ✭ 50 (+138.1%)
Mutual labels:  export
Discordchatexporter
Exports Discord chat logs to a file
Stars: ✭ 3,198 (+15128.57%)
Mutual labels:  export
ink
LaTeX + Inkscape
Stars: ✭ 22 (+4.76%)
Mutual labels:  inkscape
inkslides
A rewrite of the inkscapeslide script to create PDF presentations out of inkscape SVG files.
Stars: ✭ 24 (+14.29%)
Mutual labels:  inkscape
solrdump
Export SOLR documents efficiently with cursors.
Stars: ✭ 33 (+57.14%)
Mutual labels:  export
inkscape-multipage-export
Inkscape extension to export selected objects to various file formats.
Stars: ✭ 35 (+66.67%)
Mutual labels:  inkscape
jira-project-export
Export issues and metadata for a single JIRA project as JSON.
Stars: ✭ 18 (-14.29%)
Mutual labels:  export
mtga-utils
Magic the Gathering: Arena related stuff (Card collection export)
Stars: ✭ 47 (+123.81%)
Mutual labels:  export
Dataset Serialize
JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC)
Stars: ✭ 213 (+914.29%)
Mutual labels:  export
svg2mod
Convert Inkscape SVG drawings to KiCad footprint modules
Stars: ✭ 72 (+242.86%)
Mutual labels:  inkscape
Jsonexport
{} → 📄 it's easy to convert JSON to CSV
Stars: ✭ 208 (+890.48%)
Mutual labels:  export
pass2csv
Export pass(1), "the standard unix password manager", to CSV.
Stars: ✭ 70 (+233.33%)
Mutual labels:  export
solution-snapshotter
Take your existing .NET project and export it as a ready-to-install Visual Studio extension!
Stars: ✭ 27 (+28.57%)
Mutual labels:  export
sense-export
Just a simple button to export data in your Qlik Sense applications.
Stars: ✭ 28 (+33.33%)
Mutual labels:  export
goodrexport
Goodreads data export
Stars: ✭ 16 (-23.81%)
Mutual labels:  export

inkmake

Makefile inspired export from SVG files using Inkscape as backend with some added smartness.

If you're tired of clicking "Export Bitmap…" in Inkscape or you want to automate the process of batch exporting bitmaps or other formats from SVG files then inkmake might be something for you.

With inkmake you describe what you want to export and how using a Inkfile and then inkmake takes care of generating the necessary files.

TL;DR

# this is a Inkfile

# will generate duck.png from duck.svg
duck.png

# will generate a high resolution duck
hiresduck.png duck.svg *10

# will generate files duck.png, [email protected] and duck-right.png from animals.svg using area id @duck
images/duck[@2x|-right=*3,right].png animals.svg @duck

# will generate duckhead.png with only layer "Duck head" visible
duckhead.png -* "+Duck head" duck.svg

# output files relative to the parent directory of the Inkfile
out: ../

# read SVG files from to the directory "resources" relative to the Inkfile
svg: resources

Run using docker

This should work on Linux and macOS. Windows might need some other volume arguments.

docker run --rm -v "$PWD:$PWD" -w "$PWD" mwader/inkmake

Image is built using Dockerfile and can be found on docker hub at https://hub.docker.com/r/mwader/inkmake/

Requirements

Make sure Inkscape is installed.

On macOS, Linux and BSD Ruby might already be installed by default. If not use homebrew, apt, ports, etc to install it. On macOS make sure to start and verify the application before using inkmake.

On Windows you can use Ruby installer.

Install

gem install inkmake

Usage

Default inkmake reads a file called "Inkfile" in the current directory and will read and output files relative to the directory containing the Inkfile. But you can both specify the Inkfile path as a last argument and also change the SVG source dirctory and output directory using the --svg and --out argument options.

Usage: ./inkmake [options] [Inkfile]
    -v, --verbose                    Verbose output
    -s, --svg PATH                   SVG source base path
    -o, --out PATH                   Output base path
    -f, --force                      Force regenerate (skip time check)
    -i, --inkscape PATH              Inkscape binary path
                                     Default: /Applications/Inkscape.app/Contents/Resources/bin/inkscape
    -h, --help                       Display help

Inkfile syntax

Each line in a Inkfile describe exports to be made from a SVG file. The basic syntax looks like this:

# this is comment
file[variants].ext [options]

Where variants and options are optional. So in its simplest form a line look like this:

file.png

And would generate a file called file.png from the SVG file file.svg using the default resolution of the SVG file.

Options

options allow you to specify which part of a SVG to export and at which resolution, it also allow you to specify if the output should be rotated in some way.

duck.png animals.svg @duck *2 right

This would export the area defined by id duck from the SVG file animals.svg in double resolution and rotate the image 90 degrees clockwise.

All available options:

path.svg Source SVG file. Relative to current SVG source path.
123x123, 123in*123in Set output resolution. Supported units are px (absolute pixels, default), pt, pc, mm, cm, dm, m, in, ft and uu (user units, pixels at 90dpi).
*2, *2.5 Scale output when using non-pixel units.
+layer/*, -layer/*, +#id, -#id Show or hide layer or id. * hides or shows all layers. Are processed in order so you can do -* "+Layer 1" to only show "Layer 1". Use quotes if layer or id name has white space.
drawing Export drawing area (default whole page is exported).
@id Export area defined by id.
@x0:y0:x1:y1 Export specified area. x0:y0 is lower left, x1:y1 is upper right. In user units.
left, right, upsidedown Rotate output image, right means 90 degrees clockwise.
png, pdf, ps, eps Force output format when it can't be determined by the output path.
180dpi Change dots per inch when rendering non-pixel units (default is 90dpi).

Variants

With variants you can export more than one file with different options. This is usefull if you want to export the same SVG or part of a SVG in different resolution or rotations, and it also saves you some typing as you don't need to repeat the output path.

variants is a pipe | separated list of name=options pairs, where name is the part of the output path to be used and options are options specific to the variant. There is also a shortcut syntax for generating iOS scaled images where you only specify @2x as a variant.

 duck[@2x|-right=right|-big=1000x1000].png animals.svg @duck

Would generate the images duck.png in resolution specified by id duck, [email protected] in double resolution, duck-right.png rotated 90 degrees clockwise and duck-big.png in 1000x1000 pixels.

All available variant options:

left, right, upsidedown Rotate output image, right means 90 degrees clockwise.
123x123, 123in*123in Set output resolution. Supported units are px (absolute pixels, default), pt, pc, mm, cm, dm, m, in, ft and uu (user units, pixels at 90dpi).
*2, *2.5 Scale output when using non-pixel units.
180dpi Change dots per inch when rendering non-pixel units (default is 90dpi).

Special variants:

@2x Shortcut for @2x=*2. Usefull when generating iOS scaled images.

Paths

Both SVG base path and output base path can be set from the Inkfile or with command line arguments. The order of preference is, first command line argument then Inkfile out:/svg: configuration and if non of them is provided the paths fallback to be relative to the Inkfile.

Resolution and units

Resolutions specified in the Inkfile without units or as px will always be absolute number of pixels in output image and will not change depending on scale and dpi.

If you don't specify any resolution the resolution and units will depend on how its defined in the SVG file. In the case of SVG files saved by Inkscape this is most likely user units which is defined as pixels at 90dpi which inkmake will translate to absolute depending on scale and dpi if specified.

Development

RUBYLIB=lib bin/inkmake test/Inkfile
# increase version in inkmake.gemspec
gem build inkmake.gemspec
gem push inkmake-0.1.6.gem

TODO

Plain SVG output? does not work with areas

A bit overengeering but it seems Inkscape export is single threaded. We could use multiple shells to speed things up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].