|
| 1 | +This contains general base image assets for docs and such. |
| 2 | + |
| 3 | +- `logo.svg` is the logo source file, the base asset. It's an Inkscape SVG file, complete with relevant metadata. |
| 4 | +- `github-logo.png` is the logo export used for the GitHub profile picture. |
| 5 | +- `gitter-logo.png` is the logo export used for the Gitter avatar picture. |
| 6 | +- `open-collective-logo.png` is the logo export used for Open Collective. Unlike the GitHub and Gitter logos, this one has a transparent background. |
| 7 | +- `16.png`, `32.png`, and `48.png` are the logo exports used for the favicon. They are generated separately by Inkscape as ImageMagick's output is horrendously blurry. (I don't get how such a powerful image manipulation library can be so bad at rasterizing an SVG file, but apparently it's possible.) |
| 8 | + |
| 9 | +In the docs, some of the logos are stored there directly rather than being first generated here. |
| 10 | + |
| 11 | +- `docs/logo.svg` is just the `logo.svg` here, but size-optimized with metadata and Inkscape-specific stuff such stripped. I generated this from Inkscape as it's easier than installing npm modules and there's little point in installing a whole development dependency just to minify one (already small) SVG file. |
| 12 | +- `docs/favicon.ico` is `16.png`, `32.png`, and `48.png` from here combined into a single `.ico` file. |
| 13 | + |
| 14 | +The other favicon file, `docs/favicon.png`, is simply copied from `32.png` directly. |
| 15 | + |
| 16 | +### Generating |
| 17 | + |
| 18 | +If you want to generate all these yourself from the originals and replicate everything for yourself: |
| 19 | + |
| 20 | +1. Open `assets/logo.svg` in Inkscape. |
| 21 | + |
| 22 | +1. Save an optimized SVG copy to `docs/logo.svg` with the following settings (irrelevant ones omitted): |
| 23 | + |
| 24 | + - "Options" tab: |
| 25 | + - Shorten color values: checked |
| 26 | + - Convert CSS attributes to XML attributes: checked |
| 27 | + - Collapse groups: checked |
| 28 | + - Create groups for similar attributes: checked |
| 29 | + - Keep editor data: unchecked |
| 30 | + - Keep unreferenced definitions: unchecked |
| 31 | + - Work around renderer bugs: checked |
| 32 | + - "SVG Output" tab: |
| 33 | + - Remove the XML declaration: unchecked |
| 34 | + - Remove metadata: checked |
| 35 | + - Remove comments: checked |
| 36 | + - Embed raster images: checked |
| 37 | + - Enable viewboxing: unchecked |
| 38 | + - Format output with line-breaks and indentation: unchecked |
| 39 | + - Strip the "xml:space" attribute from the root SVG element: checked |
| 40 | + - "IDs" tab: |
| 41 | + - Remove unused IDs: checked |
| 42 | + |
| 43 | +1. Export as a PNG to `assets/github-logo.png` with the following settings: |
| 44 | + |
| 45 | + - Export area: page |
| 46 | + - Image width: 500 pixels |
| 47 | + - Image height: 500 pixels |
| 48 | + |
| 49 | +1. Export as a PNG to `assets/gitter-logo.png` with the following settings: |
| 50 | + |
| 51 | + - Export area: page |
| 52 | + - Image width: 96 pixels |
| 53 | + - Image height: 96 pixels |
| 54 | + |
| 55 | +1. Export as a PNG to `assets/open-collective-logo.png` with the following settings: |
| 56 | + |
| 57 | + - Export area: page |
| 58 | + - Image width: 256 pixels |
| 59 | + - Image height: 256 pixels |
| 60 | + |
| 61 | +1. Export as a PNG to `assets/16.png` with the following settings: |
| 62 | + |
| 63 | + - Export area: page |
| 64 | + - Image width: 16 pixels |
| 65 | + - Image height: 16 pixels |
| 66 | + |
| 67 | +1. Export as a PNG to `assets/32.png` with the following settings: |
| 68 | + |
| 69 | + - Export area: page |
| 70 | + - Image width: 32 pixels |
| 71 | + - Image height: 32 pixels |
| 72 | + |
| 73 | +1. Export as a PNG to `assets/48.png` with the following settings: |
| 74 | + |
| 75 | + - Export area: page |
| 76 | + - Image width: 48 pixels |
| 77 | + - Image height: 48 pixels |
| 78 | + |
| 79 | +1. Run the following ImageMagick commands from the repo's root: |
| 80 | + |
| 81 | + ```sh |
| 82 | + magick convert assets/github-logo.png -background white -flatten assets/github-logo.png |
| 83 | + magick convert assets/gitter-logo.png -background white -flatten assets/gitter-logo.png |
| 84 | + magick convert -background none assets/16.png assets/32.png assets/48.png docs/favicon.ico |
| 85 | + ``` |
| 86 | + |
| 87 | +1. Verify the icon has the expected sizes contained within it by running the following ImageMagick command from the root: |
| 88 | + |
| 89 | + ```sh |
| 90 | + magick identify docs/favicon.ico |
| 91 | + ``` |
| 92 | + |
| 93 | + This should print something along the lines of this: |
| 94 | + |
| 95 | + ``` |
| 96 | + docs/favicon.ico[0] ICO 16x16 16x16+0+0 8-bit sRGB 0.000u 0:00.000 |
| 97 | + docs/favicon.ico[1] ICO 32x32 32x32+0+0 8-bit sRGB 0.000u 0:00.006 |
| 98 | + docs/favicon.ico[2] ICO 48x48 48x48+0+0 8-bit sRGB 15086B 0.000u 0:00.008 |
| 99 | + ``` |
| 100 | + |
| 101 | +1. Copy `assets/32.png` to `docs/favicon.png`. |
0 commit comments