Skip to content

Allow the user to supply pixel-perfect icons at both 1x and 2x resolutions #144

Description

@joerick

Currently when the --retina flag is used, the input images are assumed to be the 2x version and the 1x version is generated by scaling. I'd like the option to provide two resolutions of each icon and have the 1x version used instead of a scaled version.

Apple's convention for this in UIKit and AppKit are to have filename.png and filename@2x.png for each asset. I see glue has adopted this in it's output, perhaps we could do the same for input files, so for a filenames like:

nav-arrow-left_hover.png
nav-arrow-left_hover@2x.png
nav-arrow-left.png
nav-arrow-left@2x.png
nav-arrow-right_hover.png
nav-arrow-right_hover@2x.png
nav-arrow-right.png
nav-arrow-right@2x.png

I'd like to supply a pull-request, but I'd like the maintainer's/community's opinion on a couple questions-

  • Do we roll this into the --retina and --ratios= commands, or make something separate?

Advantages of rolling into the existing commands would be that the user could supply pixel-perfect 1x versions for some icons and accept the scaled versions for others. Only problem with that is the abiguity between the fact that normally a filename without '@2x' goes to the '@2x' spritesheet, but in this case a filename with '@2x' goes to the standard resolution spritesheet (or we could adopt a convention of '@1x' instead?)

  • Order of the suffixes, i.e. nav-arrow-left_hover@2x.png or nav-arrow-left@2x_hover.png. I think I'm in favor of nav-arrow-left_hover@2x.png.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions