{"id":16892784,"url":"https://github.com/wader/inkmake","last_synced_at":"2025-10-04T03:31:01.095Z","repository":{"id":1780909,"uuid":"2704114","full_name":"wader/inkmake","owner":"wader","description":"Makefile inspired export from SVG files using Inkscape as backend with some added smartness.","archived":false,"fork":false,"pushed_at":"2021-08-30T09:38:54.000Z","size":55,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-23T16:49:25.284Z","etag":null,"topics":["export","inkscape","ruby","svg"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/inkmake","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wader.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-03T18:27:26.000Z","updated_at":"2025-02-08T21:55:29.000Z","dependencies_parsed_at":"2022-09-07T17:01:54.727Z","dependency_job_id":null,"html_url":"https://github.com/wader/inkmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wader/inkmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Finkmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Finkmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Finkmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Finkmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wader","download_url":"https://codeload.github.com/wader/inkmake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Finkmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278259818,"owners_count":25957542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["export","inkscape","ruby","svg"],"created_at":"2024-10-13T17:12:22.316Z","updated_at":"2025-10-04T03:31:00.809Z","avatar_url":"https://github.com/wader.png","language":"Ruby","readme":"inkmake\n=======\n\nMakefile inspired export from SVG files using Inkscape as backend with some added smartness.\n\nIf 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.\n\nWith inkmake you describe what you want to export and how using a `Inkfile` and then inkmake takes care of generating the necessary files.\n\n### TL;DR\n\n    # this is a Inkfile\n\n    # will generate duck.png from duck.svg\n    duck.png\n\n    # will generate a high resolution duck\n    hiresduck.png duck.svg *10\n\n    # will generate files duck.png, duck@2x.png and duck-right.png from animals.svg using area id @duck\n    images/duck[@2x|-right=*3,right].png animals.svg @duck\n\n    # will generate duckhead.png with only layer \"Duck head\" visible\n    duckhead.png -* \"+Duck head\" duck.svg\n\n    # output files relative to the parent directory of the Inkfile\n    out: ../\n\n    # read SVG files from to the directory \"resources\" relative to the Inkfile\n    svg: resources\n\n### Run using docker\n\nThis should work on Linux and macOS. Windows might need some other volume arguments.\n\n```sh\ndocker run --rm -v \"$PWD:$PWD\" -w \"$PWD\" mwader/inkmake\n```\n\nImage is built using [Dockerfile](Dockerfile) and can be found on docker hub at https://hub.docker.com/r/mwader/inkmake/\n\n### Requirements\n\nMake sure Inkscape is installed.\n\nOn  macOS, Linux and BSD Ruby might already be installed by default. If not use homebrew, apt, ports, etc to install it.\nOn macOS make sure to start and verify the application before using inkmake.\n\nOn Windows you can use [Ruby installer](http://rubyinstaller.org).\n\n### Install\n\n\tgem install inkmake\n\n### Usage\n\nDefault 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.\n\n\n\tUsage: ./inkmake [options] [Inkfile]\n\t    -v, --verbose                    Verbose output\n\t    -s, --svg PATH                   SVG source base path\n\t    -o, --out PATH                   Output base path\n\t    -f, --force                      Force regenerate (skip time check)\n\t    -i, --inkscape PATH              Inkscape binary path\n\t                                     Default: /Applications/Inkscape.app/Contents/Resources/bin/inkscape\n\t    -h, --help                       Display help\n\n### Inkfile syntax\n\nEach line in a Inkfile describe exports to be made from a SVG file. The basic syntax looks like this:\n\n    # this is comment\n    file[variants].ext [options]\n\nWhere `variants` and `options` are optional. So in its simplest form a line look like this:\n\n    file.png\n\nAnd would generate a file called `file.png` from the SVG file `file.svg` using the default resolution of the SVG file.\n\n#### Options\n\n`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.\n\n    duck.png animals.svg @duck *2 right\n\nThis would export the area defined by id `duck` from the SVG file `animals.svg` in double resolution and rotate the image 90 degrees clockwise.\n\nAll available options:\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003epath.svg\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eSource SVG file. Relative to current SVG source path.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e123x123, 123in*123in\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eSet output resolution. Supported units are\n\t\t\t\u003ccode\u003epx\u003c/code\u003e (absolute pixels, default), \n\t\t\t\u003ccode\u003ept\u003c/code\u003e, \n \t\t\t\u003ccode\u003epc\u003c/code\u003e, \n \t\t   \t\u003ccode\u003emm\u003c/code\u003e, \n \t\t   \t\u003ccode\u003ecm\u003c/code\u003e, \n \t\t   \t\u003ccode\u003edm\u003c/code\u003e, \n \t\t   \t\u003ccode\u003em\u003c/code\u003e, \n \t\t   \t\u003ccode\u003ein\u003c/code\u003e, \n \t\t   \t\u003ccode\u003eft\u003c/code\u003e and \n \t\t   \t\u003ccode\u003euu\u003c/code\u003e (user units, pixels at 90dpi).\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e*2\u003c/code\u003e, \u003ccode\u003e*2.5\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eScale output when using non-pixel units.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e+layer/*\u003c/code\u003e, \u003ccode\u003e-layer/*\u003c/code\u003e, \u003ccode\u003e+#id\u003c/code\u003e, \u003ccode\u003e-#id\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\tShow or hide layer or id. \u003ccode\u003e*\u003c/code\u003e hides or shows all layers.\n\t\t\tAre processed in order so you can do \u003ccode\u003e-* \"+Layer 1\"\u003c/code\u003e to only show \"Layer 1\"\u003c/code\u003e. Use quotes if layer or id name has white space.\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003edrawing\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eExport drawing area (default whole page is exported).\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e@id\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eExport area defined by \u003ccode\u003eid\u003c/code\u003e.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e@x0:y0:x1:y1\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eExport specified area. \u003ccode\u003ex0:y0\u003c/code\u003e is lower left, \u003ccode\u003ex1:y1\u003c/code\u003e is upper right. In user units.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003eleft\u003c/code\u003e, \u003ccode\u003eright\u003c/code\u003e, \u003ccode\u003eupsidedown\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eRotate output image, \u003ccode\u003eright\u003c/code\u003e means 90 degrees clockwise.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003epng\u003c/code\u003e, \u003ccode\u003epdf\u003c/code\u003e, \u003ccode\u003eps\u003c/code\u003e, \u003ccode\u003eeps\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eForce output format when it can't be determined by the output path.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e180dpi\u003c/code\u003c/td\u003e\n\t\t\u003ctd\u003eChange dots per inch when rendering non-pixel units (default is 90dpi).\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n\n#### Variants\n\nWith 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.\n\n`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.\n\n     duck[@2x|-right=right|-big=1000x1000].png animals.svg @duck\n\nWould generate the images `duck.png` in resolution specified by id `duck`, `duck@2x.png` in double resolution, `duck-right.png` rotated 90 degrees clockwise and `duck-big.png` in 1000x1000 pixels.\n\nAll available variant options:\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003eleft\u003c/code\u003e, \u003ccode\u003eright\u003c/code\u003e, \u003ccode\u003eupsidedown\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eRotate output image, \u003ccode\u003eright\u003c/code\u003e means 90 degrees clockwise.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e123x123, 123in*123in\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eSet output resolution. Supported units are\n\t\t\t\u003ccode\u003epx\u003c/code\u003e (absolute pixels, default), \n\t\t\t\u003ccode\u003ept\u003c/code\u003e, \n \t\t\t\u003ccode\u003epc\u003c/code\u003e, \n \t\t   \t\u003ccode\u003emm\u003c/code\u003e, \n \t\t   \t\u003ccode\u003ecm\u003c/code\u003e, \n \t\t   \t\u003ccode\u003edm\u003c/code\u003e, \n \t\t   \t\u003ccode\u003em\u003c/code\u003e, \n \t\t   \t\u003ccode\u003ein\u003c/code\u003e, \n \t\t   \t\u003ccode\u003eft\u003c/code\u003e and \n \t\t   \t\u003ccode\u003euu\u003c/code\u003e (user units, pixels at 90dpi).\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e*2\u003c/code\u003e, \u003ccode\u003e*2.5\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eScale output when using non-pixel units.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e180dpi\u003c/code\u003c/td\u003e\n\t\t\u003ctd\u003eChange dots per inch when rendering non-pixel units (default is 90dpi).\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\nSpecial variants:\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003ccode\u003e@2x\u003c/code\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eShortcut for \u003ccode\u003e@2x=*2\u003c/code\u003e. Usefull when generating iOS scaled images.\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n### Paths\n\nBoth 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`.\n\n### Resolution and units\n\nResolutions 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.\n\nIf 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.\n\n### Development\n\n```sh\nRUBYLIB=lib bin/inkmake test/Inkfile\n```\n\n```sh\n# increase version in inkmake.gemspec\ngem build inkmake.gemspec\ngem push inkmake-0.1.6.gem\n```\n\n\n### TODO\n\n Plain SVG output? does not work with areas\n\n A bit overengeering but it seems Inkscape export is single threaded. We could use multiple shells to speed things up.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwader%2Finkmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwader%2Finkmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwader%2Finkmake/lists"}