The Photoshop Generator feature offers great flexibility in the ways you can rename layers/layer groups to specify size and quality parameters. Stepping beyond the recommendations in the Help article, this blog post looks at some valid variations that you can use while tagging layer/layer group names.

Before we begin, let’s look at the conventions followed in this blog post:

Space case

The filename portion of a layer/layer group name can include space characters. For example:250% Foo Bar Baz.gifResult: Generates a single file named Foo Bar Baz.gif scaled by 250%

While specifying absolute sizes, you can omit the space character between the height and the width. For example:100×80 foo.pngResult: Generates a 100 px x 80 px-sized PNG file named foo.png

Do add a space character between the size parameter (prefix) and the layer name. For example:100×100 foo.png

You can omit the space character following the separator (, or +). For example, any of the following layer names generates two files—foo 1.png and foo 2.jpg—from the tagged layer:foo 1.png,foo 2.jpgfoo 1.png, foo 2.jpgfoo 1.png+foo 2.jpgfoo 1.png + foo 2.jpg

Do not add a space character between an absolute size dimension and its unit. For example, the following layer names are invalid:80 x 100 px imagename.png4 in x100 imagename.png90 mm x120 cm imagename.png

Do not add a space character between the layer name and the suffix. For example, the following layer/layer group name is invalid:100×100 imagename.png 5%

Mixing units

While specifying the size parameter, it’s OK to mix and match the supported units—px, cm, mm, and in.

If no unit is specified for a dimension, Photoshop assumes it to be px.

Examples:

80 x 100px foo.png

4in x100 foo.png

90mm x120cm foo.png

Wild cards

While specifying absolute sizes, you can use the ? wildcard in place of a dimension.

Examples:

100x? foo.png

?x60in foo.png

Hyphenated quality parameters

You can add a hyphen before the quality parameter (suffix) to make your layer/layer group names more readable.

Examples:

foo.png-8

foo.jpg-100%

foo.png-32

Some other Don’t’s

Don’t use unsupported units.

Don’t mix absolute and relative sizes. For example, the following layer name is not valid:50% 80×100 foo.png