Giter Club home page Giter Club logo

marm's Introduction

MARM

MARM is a simple tool for processing assets for different device resolutions.

Building

To build run:

ant dist

This will create marm_app.jar. To simplify its use you may create an alias:

alias marm="java -jar `pwd`/marm_app.jar"

Usage

The two main operation modes are resize and pack:

marm [OPTIONS] resize <dir-in> <dir-out>
marm [OPTIONS] pack <dir-in> <dir-out> <atlas name>

The files recognized and processed in <dir-in> are inkscape SVG, PNG and HIERO font files. Any other file is copied to the three destination directories as as.

Valid options are:

name=value          # set variable
-<n>                # request a particular size (n = 1, 2, 4 or 8)
-v                  # be verbose

If you don't specify any sizes then the tool will assume x1, x2 and x4.

Conversion rules

The conversion rules are any part of the filename between the last '_' and the file extension. For example the file A.svg with the conversion rules 2, 4 and p is renamed to A_24p.svg.

The rules decide how each file will be processed:

  • Plain files: p specifies that the file will not be processed for removing alpha-blended pixels.
  • Keep file: k specifies that the file will not be scaled.
  • Scale rules: 1/2/4/8 specifies the target scales.

For example the file A.svg will be converted to A.png and scaled to x1, x2 and x4. The result will be stored in 1/A.png, 2/A.png and 4/A.png However, if we were instead given A_12p.svg and A_4.svg the former would have been used to create 1/A.png and 2/A.png without alpha processing while the latter would have been used to create 4/A.png.

If a size is missing, marm will try to guess a compatible source.

Variables

MARM assumes the following commands to be available

  • convert
  • inkscape
  • hiero

You can replace these with your own, for example you can do:

marm inkscape="/opt/inkscape/bin/inkscape --export-background=red" resize indir outdir

marm's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.