https://github.com/ttulka/as-inliner-image
Inlines images into your AssemblyScript
https://github.com/ttulka/as-inliner-image
assemblyscript image png rgba transform
Last synced: 8 months ago
JSON representation
Inlines images into your AssemblyScript
- Host: GitHub
- URL: https://github.com/ttulka/as-inliner-image
- Owner: ttulka
- License: mit
- Created: 2021-08-17T17:46:56.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-18T06:34:24.000Z (almost 5 years ago)
- Last Synced: 2025-04-25T12:07:36.184Z (about 1 year ago)
- Topics: assemblyscript, image, png, rgba, transform
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# as-inliner-image
[AssemblyScript](https://github.com/AssemblyScript/assemblyscript) transform to inline images as arrays of RGBA values 🚀
Based on https://github.com/surma/as-inliner
## Install
```sh
npm i as-inliner-image -D
```
## Use
```typescript
const image: StaticArray = Inliner.inlineImageAsRgbaStaticArray(
"../assets/image.png"
);
```
Inlining works through [ASC transforms](https://www.assemblyscript.org/transforms.html#transforms):
```sh
npx asc assembly/index.ts --transform as-inliner-image
```
or place it in your `asconfig.json`:
```json
{
...
"options": {
"transform": ["as-inliner-image"]
}
}
```
Or extend the `asconfig.json` here:
```json
{
"extend": "as-inliner-image/asconfig.json"
}
```
## Limitations
Currently supported image formats:
- PNG
## Licence
[MIT](https://github.com/ttulka/as-inliner-image/blob/main/LICENSE)