https://github.com/swiftdo/flutter_imges_generator
flutter 图片生成器,将 3x 生成 1x 2x 3x 等
https://github.com/swiftdo/flutter_imges_generator
Last synced: 11 months ago
JSON representation
flutter 图片生成器,将 3x 生成 1x 2x 3x 等
- Host: GitHub
- URL: https://github.com/swiftdo/flutter_imges_generator
- Owner: swiftdo
- Created: 2022-04-02T02:09:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-02T03:48:02.000Z (over 4 years ago)
- Last Synced: 2025-01-14T05:44:20.963Z (over 1 year ago)
- Language: Python
- Size: 37.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 生成 flutter 结构的图片
做重复的工作是很烦人的。
```
Do not repeat yourself!
```
本工具直接将 3x 图生成到 assets 目录中。
assets 目录中包含 1x,2x, 3x 的图片,已帮你做好按 flutter 标准目录归类。
支持3倍图命名`@3x.png、.png`
## 使用
拉取项目:
```py
git clone https://github.com/swiftdo/flutter_imges_generator.git
```
**直接将你要生成的图片放入到该项目里面。**
然后执行:
```sh
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ python resize.py
```
执行完成后,会生成如下目录:
```
$ tree .
.
├── README.md
├── add_success.png
├── assets
│ ├── 2x
│ │ ├── add_success.png
│ │ └── limit.png
│ ├── 3x
│ │ ├── add_success.png
│ │ └── limit.png
│ ├── add_success.png
│ └── limit.png
├── limit@3x.png
├── requirements.txt
└── resize.py
```
**assets** 目录就是你要的文件。当然为了获得更小的资源,可以用工具 [ImageOptim](https://imageoptim.com/mac) 批量压缩。
## 关于
个人博客站点:[oldbird.run](https://oldbird.run)