forked from pixijs/assetpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
combine mipmap and compress into image
- Loading branch information
Showing
48 changed files
with
102 additions
and
223 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# @assetpack/plugin-image | ||
|
||
AssetPack plugin for compressing and mipmapping images into different formats. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install --save-dev @assetpack/plugin-image | ||
``` | ||
|
||
## Basic Usage | ||
|
||
```js | ||
import { compress, mipmap } from "@assetpack/plugin-image"; | ||
|
||
export default { | ||
... | ||
plugins: { | ||
... | ||
mipmap: mipmap(), | ||
compress: compress(), | ||
}, | ||
}; | ||
``` | ||
|
||
## Options | ||
|
||
### compress | ||
|
||
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`. | ||
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file. | ||
- jpg: Any settings supported by [sharp](https://sharp.pixelplumbing.com/api-output#jpeg) | ||
- png: Any settings supported by [sharp](https://sharp.pixelplumbing.com/api-output#png) | ||
- webp: Any settings supported by [sharp](https://sharp.pixelplumbing.com/api-output#webp) | ||
- avif: Any settings supported by [sharp](https://sharp.pixelplumbing.com/api-output#avif) | ||
|
||
### mipmap | ||
|
||
- `template`: A template for denoting the resolution of the images. Defaults to `@%%x`. Note you must use `%%` to denote the resolution. | ||
- `resolutions`: An object containing the resolutions that the images will be resized to. Defaults to `{ default: 1, low: 0.5 }`. | ||
- `fixedResolution`: A resolution used if the fix tag is applied e.g. `path/to/image{fix}.png` or `path/to{fix}`. Resolution must match one found in resolutions. Defaults to `default`. | ||
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ fix: "fix" }`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './compress'; | ||
export * from './mipmap'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/compress/src/utils/compressSharp.ts → packages/image/src/utils/compressSharp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/mipmap/src/utils/mipmapSharp.ts → packages/image/src/utils/mipmapSharp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.