Skip to content

Commit d6d3c88

Browse files
committed
doc: update readme for autosize
1 parent 6a82adc commit d6d3c88

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Oleg Geier
1+
Copyright 2021-2023 relikd
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ Or you can install it **manually** by creating a symlink to `cli.py`:
1414

1515
```sh
1616
ln -s '/absolute/path/to/icnsutil/icnsutil/cli.py' /usr/local/bin/icnsutil
17+
ln -s '/absolute/path/to/icnsutil/icnsutil/autosize/cli.py' /usr/local/bin/icnsutil-autosize
1718
```
1819

1920
Or call the python module (if the module is in the search path):
2021

2122
```sh
2223
python3 -m icnsutil
24+
python3 -m icnsutil.autosize
2325
```
2426

2527

2628
## Usage
2729

30+
See [#tools](#tools) for further options on icns processing (e.g., autosize).
31+
2832
```
2933
positional arguments:
3034
command
@@ -128,7 +132,33 @@ with open('32x32.mask', 'wb') as fp:
128132

129133
Note: the CLI `export` command will fail if you run `--convert` without Pillow.
130134

131-
## HTML icon viewer
135+
136+
## Tools
137+
138+
### Autosize
139+
140+
`icnsutil.autosize` is a tool to automatically generate smaller icon sizes from a larger one.
141+
Currently, autosize has support for “normal” raster images (via sips or Pillow) and SVG images (via [resvg] or Chrome Headless).
142+
143+
```sh
144+
icnsutil-autosize icon.svg -32 intermediate.png -16 small.svg
145+
# or
146+
python3 -m icnsutil.autosize icon.svg -32 intermediate.png -16 small.svg
147+
```
148+
149+
Additionally, `autosize` will also try to convert 32px and 16px PNG images to ARGB.
150+
If Pillow is not installed, this step will be skipped (without negative side effects).
151+
The output is an iconset folder with all necessary images.
152+
153+
You may ask why this tool does not create the icns file immediatelly?
154+
This way you can modify the generated images before packing them into an icns file.
155+
For example, you can run [ImageOptim] to compress the images and reduce the overall icns filesize.
156+
157+
[resvg]: https://github.com/RazrFalcon/resvg/
158+
[ImageOptim]: https://github.com/ImageOptim/ImageOptim
159+
160+
161+
### HTML icon viewer
132162

133163
Here are two tools to open icns files directly in your browser. Both tools can be used either with an icns file or a rgb / argb image file.
134164

0 commit comments

Comments
 (0)