Fix assets [skip ci]

This commit is contained in:
Isiah Meadows 2020-09-14 18:54:47 -07:00
parent ff3e12e5d3
commit 6d1dab07eb
14 changed files with 180 additions and 54 deletions

5
.gitattributes vendored
View file

@ -3,3 +3,8 @@
/mithril.min.js binary
/package-lock.json binary
/yarn.lock binary
# Assets
*.png binary
*.svg binary
*.ico binary

BIN
assets/16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

BIN
assets/32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

94
assets/README.md Normal file
View file

@ -0,0 +1,94 @@
This contains general base image assets for docs and such.
- `logo.svg` is the logo source file, the base asset. It's an Inkscape SVG file, complete with relevant metadata.
- `github-logo.png` is the logo export used for the GitHub profile picture.
- `gitter-logo.png` is the logo export used for the Gitter avatar picture.
- `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.)
In the docs, some of the logos are stored there directly rather than being first generated here.
- `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.
- `docs/favicon.ico` is `16.png`, `32.png`, and `48.png` from here combined into a single `.ico` file.
The other favicon file, `docs/favicon.png`, is simply copied from `32.png` directly.
### Generating
If you want to generate all these yourself from the originals and replicate everything for yourself:
1. Open `assets/logo.svg` in Inkscape.
1. Save an optimized SVG copy to `docs/logo.svg` with the following settings (irrelevant ones omitted):
- "Options" tab:
- Shorten color values: checked
- Convert CSS attributes to XML attributes: checked
- Collapse groups: checked
- Create groups for similar attributes: checked
- Keep editor data: unchecked
- Keep unreferenced definitions: unchecked
- Work around renderer bugs: checked
- "SVG Output" tab:
- Remove the XML declaration: unchecked
- Remove metadata: checked
- Remove comments: checked
- Embed raster images: checked
- Enable viewboxing: unchecked
- Format output with line-breaks and indentation: unchecked
- Strip the "xml:space" attribute from the root SVG element: checked
- "IDs" tab:
- Remove unused IDs: checked
1. Export as a PNG to `assets/github-logo.png` with the following settings:
- Export area: page
- Image width: 500 pixels
- Image height: 500 pixels
1. Export as a PNG to `assets/gitter-logo.png` with the following settings:
- Export area: page
- Image width: 96 pixels
- Image height: 96 pixels
1. Export as a PNG to `assets/16.png` with the following settings:
- Export area: page
- Image width: 16 pixels
- Image height: 16 pixels
1. Export as a PNG to `assets/32.png` with the following settings:
- Export area: page
- Image width: 32 pixels
- Image height: 32 pixels
1. Export as a PNG to `assets/48.png` with the following settings:
- Export area: page
- Image width: 48 pixels
- Image height: 48 pixels
1. Run the following ImageMagick commands from the repo's root:
```sh
magick convert assets/github-logo.png -background white -flatten assets/github-logo.png
magick convert assets/gitter-logo.png -background white -flatten assets/gitter-logo.png
magick convert -background none assets/16.png assets/32.png assets/48.png docs/favicon.ico
```
1. Verify the icon has the expected sizes contained within it by running the following ImageMagick command from the root:
```sh
magick identify docs/favicon.ico
```
This should print something along the lines of this:
```
docs/favicon.ico[0] ICO 16x16 16x16+0+0 8-bit sRGB 0.000u 0:00.000
docs/favicon.ico[1] ICO 32x32 32x32+0+0 8-bit sRGB 0.000u 0:00.006
docs/favicon.ico[2] ICO 48x48 48x48+0+0 8-bit sRGB 15086B 0.000u 0:00.008
```
1. Copy `assets/32.png` to `docs/favicon.png`.

BIN
assets/github-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
assets/gitter-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

79
assets/logo.svg Normal file
View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
enable-background="new 0 0 38.044 38.044"
version="1.1"
viewBox="0 0 38.044 38.044"
id="svg4"
sodipodi:docname="logo.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="C:\Users\impin\projects\mithril.js\assets\github-logo.png"
inkscape:export-xdpi="1261.7"
inkscape:export-ydpi="1261.7">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<cc:license
rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
<dc:creator>
<cc:Agent>
<dc:title>Leo Horie</dc:title>
</cc:Agent>
</dc:creator>
<dc:contributor>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:contributor>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1368"
inkscape:window-height="850"
id="namedview6"
showgrid="false"
inkscape:zoom="16.822627"
inkscape:cx="9.6794233"
inkscape:cy="19.021999"
inkscape:window-x="-6"
inkscape:window-y="-6"
inkscape:window-maximized="1"
inkscape:current-layer="svg4"
inkscape:document-rotation="0" />
<path
d="m31.716 24.543c-0.017 7.03-5.742 12.745-12.776 12.745-7.045 0-12.777-5.732-12.777-12.777 0-0.022 4e-3 -0.043 4e-3 -0.065-3.69-2.243-6.167-6.29-6.167-10.914 0-7.046 5.731-12.777 12.777-12.777 2.268 0 4.395 0.601 6.244 1.642 1.849-1.041 3.977-1.642 6.245-1.642 7.046 0 12.777 5.732 12.777 12.777 0 4.691-2.548 8.789-6.327 11.011zm-12.695-19.461c-2.312 1.713-3.906 4.341-4.22 7.352 1.3-0.448 2.689-0.702 4.139-0.702 1.514 0 2.96 0.278 4.307 0.764-0.298-3.037-1.898-5.689-4.226-7.414zm-10.504 18.063c1.303 0.579 2.743 0.909 4.26 0.909 1.475 0 2.879-0.307 4.154-0.858-2.114-1.826-3.629-4.325-4.195-7.167-2.263 1.662-3.838 4.2-4.219 7.116zm10.423-9.157c-1.457 0-2.846 0.298-4.109 0.837 0.361 2.928 1.929 5.482 4.19 7.157 2.243-1.662 3.802-4.187 4.18-7.085-1.304-0.581-2.744-0.909-4.261-0.909zm2.171 9.209c1.275 0.55 2.679 0.858 4.154 0.858 1.457 0 2.846-0.298 4.11-0.837-0.356-2.885-1.883-5.404-4.089-7.082-0.582 2.799-2.087 5.257-4.175 7.061zm-2.171 11.836c5.432 0 9.915-4.137 10.466-9.425-1.3 0.447-2.689 0.702-4.14 0.702-2.268 0-4.396-0.601-6.245-1.642-1.848 1.041-3.975 1.642-6.244 1.642-1.514 0-2.96-0.278-4.307-0.763 0.523 5.317 5.018 9.486 10.47 9.486zm-6.163-32.024c-5.803 0-10.523 4.72-10.523 10.523 0 3.418 1.645 6.451 4.177 8.375 0.744-3.581 2.999-6.607 6.059-8.408 0.011-3.847 1.735-7.293 4.442-9.631-1.276-0.552-2.679-0.859-4.155-0.859zm12.489 0c-1.475 0-2.879 0.307-4.154 0.858 2.715 2.345 4.444 5.804 4.444 9.664 0 0.022-4e-3 0.044-4e-3 0.065 3.007 1.829 5.209 4.852 5.918 8.416 2.613-1.917 4.319-4.999 4.319-8.48-1e-3 -5.802-4.721-10.523-10.523-10.523z"
fill="#010002"
id="path2" />
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
docs/16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
docs/32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
docs/48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -1,54 +1,2 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 38.044 38.044" style="enable-background:new 0 0 38.044 38.044;" xml:space="preserve">
<g>
<g>
<path style="fill:#010002;" d="M31.716,13.5C31.699,6.47,25.974,0.755,18.94,0.755c-7.045,0-12.777,5.732-12.777,12.777
c0,0.022,0.004,0.043,0.004,0.065C2.477,15.84,0,19.887,0,24.511c0,7.046,5.731,12.777,12.777,12.777
c2.268,0,4.395-0.601,6.244-1.642c1.849,1.041,3.977,1.642,6.245,1.642c7.046,0,12.777-5.732,12.777-12.777
C38.043,19.82,35.495,15.722,31.716,13.5z M19.021,32.961c-2.312-1.713-3.906-4.341-4.22-7.352c1.3,0.448,2.689,0.702,4.139,0.702
c1.514,0,2.96-0.278,4.307-0.764C22.949,28.584,21.349,31.236,19.021,32.961z M8.517,14.898c1.303-0.579,2.743-0.909,4.26-0.909
c1.475,0,2.879,0.307,4.154,0.858c-2.114,1.826-3.629,4.325-4.195,7.167C10.473,20.352,8.898,17.814,8.517,14.898z M18.94,24.055
c-1.457,0-2.846-0.298-4.109-0.837c0.361-2.928,1.929-5.482,4.19-7.157c2.243,1.662,3.802,4.187,4.18,7.085
C21.897,23.727,20.457,24.055,18.94,24.055z M21.111,14.846c1.275-0.55,2.679-0.858,4.154-0.858c1.457,0,2.846,0.298,4.11,0.837
c-0.356,2.885-1.883,5.404-4.089,7.082C24.704,19.108,23.199,16.65,21.111,14.846z M18.94,3.01c5.432,0,9.915,4.137,10.466,9.425
c-1.3-0.447-2.689-0.702-4.14-0.702c-2.268,0-4.396,0.601-6.245,1.642c-1.848-1.041-3.975-1.642-6.244-1.642
c-1.514,0-2.96,0.278-4.307,0.763C8.993,7.179,13.488,3.01,18.94,3.01z M12.777,35.034c-5.803,0-10.523-4.72-10.523-10.523
c0-3.418,1.645-6.451,4.177-8.375c0.744,3.581,2.999,6.607,6.059,8.408c0.011,3.847,1.735,7.293,4.442,9.631
C15.656,34.727,14.253,35.034,12.777,35.034z M25.266,35.034c-1.475,0-2.879-0.307-4.154-0.858
c2.715-2.345,4.444-5.804,4.444-9.664c0-0.022-0.004-0.044-0.004-0.065c3.007-1.829,5.209-4.852,5.918-8.416
c2.613,1.917,4.319,4.999,4.319,8.48C35.788,30.313,31.068,35.034,25.266,35.034z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 38.044 38.044" version="1.1" viewBox="0 0 38.044 38.044" xmlns="http://www.w3.org/2000/svg"><path d="m31.716 24.543c-0.017 7.03-5.742 12.745-12.776 12.745-7.045 0-12.777-5.732-12.777-12.777 0-0.022 4e-3 -0.043 4e-3 -0.065-3.69-2.243-6.167-6.29-6.167-10.914 0-7.046 5.731-12.777 12.777-12.777 2.268 0 4.395 0.601 6.244 1.642 1.849-1.041 3.977-1.642 6.245-1.642 7.046 0 12.777 5.732 12.777 12.777 0 4.691-2.548 8.789-6.327 11.011zm-12.695-19.461c-2.312 1.713-3.906 4.341-4.22 7.352 1.3-0.448 2.689-0.702 4.139-0.702 1.514 0 2.96 0.278 4.307 0.764-0.298-3.037-1.898-5.689-4.226-7.414zm-10.504 18.063c1.303 0.579 2.743 0.909 4.26 0.909 1.475 0 2.879-0.307 4.154-0.858-2.114-1.826-3.629-4.325-4.195-7.167-2.263 1.662-3.838 4.2-4.219 7.116zm10.423-9.157c-1.457 0-2.846 0.298-4.109 0.837 0.361 2.928 1.929 5.482 4.19 7.157 2.243-1.662 3.802-4.187 4.18-7.085-1.304-0.581-2.744-0.909-4.261-0.909zm2.171 9.209c1.275 0.55 2.679 0.858 4.154 0.858 1.457 0 2.846-0.298 4.11-0.837-0.356-2.885-1.883-5.404-4.089-7.082-0.582 2.799-2.087 5.257-4.175 7.061zm-2.171 11.836c5.432 0 9.915-4.137 10.466-9.425-1.3 0.447-2.689 0.702-4.14 0.702-2.268 0-4.396-0.601-6.245-1.642-1.848 1.041-3.975 1.642-6.244 1.642-1.514 0-2.96-0.278-4.307-0.763 0.523 5.317 5.018 9.486 10.47 9.486zm-6.163-32.024c-5.803 0-10.523 4.72-10.523 10.523 0 3.418 1.645 6.451 4.177 8.375 0.744-3.581 2.999-6.607 6.059-8.408 0.011-3.847 1.735-7.293 4.442-9.631-1.276-0.552-2.679-0.859-4.155-0.859zm12.489 0c-1.475 0-2.879 0.307-4.154 0.858 2.715 2.345 4.444 5.804 4.444 9.664 0 0.022-4e-3 0.044-4e-3 0.065 3.007 1.829 5.209 4.852 5.918 8.416 2.613-1.917 4.319-4.999 4.319-8.48-1e-3 -5.802-4.721-10.523-10.523-10.523z" fill="#010002"/></svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After