https://github.com/sulkmqul/clarity.image
APNG library for C# .net
https://github.com/sulkmqul/clarity.image
apng csharp csharp-library
Last synced: 6 months ago
JSON representation
APNG library for C# .net
- Host: GitHub
- URL: https://github.com/sulkmqul/clarity.image
- Owner: sulkmqul
- License: other
- Created: 2024-02-13T16:29:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-15T21:18:33.000Z (about 2 years ago)
- Last Synced: 2025-03-13T12:14:48.647Z (over 1 year ago)
- Topics: apng, csharp, csharp-library
- Language: C#
- Homepage:
- Size: 50.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clarity.Image
APNG and PNG library for C# .net.
C#でapngを扱うライブラリおよび使用サンプルです。
apngファイルを読み込み、フレームごとのRGBA形式のバッファを作成して保持します。
System.Drawing.Bitmapでも使用できるようにRGBA形式から相互変換関数も含めておきました。
RGBA形式が基準なので、ある程度は汎用的に利用できると思います。
apngの読み込みを書いていたら自然とpngの方も出来ちゃったので含めていますが、
pngはおまけみたいなもんで、普通に.net標準の方使った方が便利だと思います。
## Build
C#
Visual Studio 2022
.Net6
[System.IO.Hashing-8.0.0](https://www.nuget.org/packages/System.IO.Hashing/8.0.0)
## Supported image formats
#### 読み込み
- 8bit TrueColor
- 8bit TrueColorWithAlpha
- 8bit IndexedColor
#### 書み込み
- 8bit TrueColorWithAlpha
## Usage
### APNG
#### Read
```
Clarity.Image.PNG.APngFile ap = new Clarity.Image.PNG.APngFile();
await ap.Load(@"anime.png");
```
#### Write
```
List framelist = new List();
//Set image size, delay time and rgba buffer to APngFrame
APngWriter aw = new APngWriter();
await aw.Save("save_anime.png", framelist);
```
### PNG
#### Read
```
Clarity.Image.PNG.PngFile png = new Clarity.Image.PNG.PngFile();
awit png.Load(@"image.png");
```
#### Write
```
Clarity.Image.PNG.PngWriter pw = new Clarity.Image.PNG.PngWriter();
await pw.Save(@"save.png", png.Width, png.Height, png.Data);
```
詳しくはPngTest.Program.csを見てください。
####
## Author
sulkmqul
## LICENSE
[WTFPL](http://www.wtfpl.net/)