https://github.com/tinify/tinify-net
.NET client for the Tinify API.
https://github.com/tinify/tinify-net
c-sharp image-compression image-optimization tinyjpg tinypng
Last synced: 5 months ago
JSON representation
.NET client for the Tinify API.
- Host: GitHub
- URL: https://github.com/tinify/tinify-net
- Owner: tinify
- License: mit
- Created: 2017-01-23T20:45:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-19T08:28:12.000Z (7 months ago)
- Last Synced: 2025-04-13T06:26:10.006Z (6 months ago)
- Topics: c-sharp, image-compression, image-optimization, tinyjpg, tinypng
- Language: C#
- Homepage: https://tinypng.com/developers
- Size: 385 KB
- Stars: 52
- Watchers: 11
- Forks: 26
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
[ ](https://github.com/tinify/tinify-python/blob/main/LICENSE)
[](https://github.com/tinify/tinify-net/actions/workflows/ci-cd.yml)
[](https://www.nuget.org/packages/Tinify)# Tinify API client for .NET
.NET client for the Tinify API, used for [TinyPNG](https://tinypng.com) and [TinyJPG](https://tinyjpg.com). Tinify compresses your images intelligently. Read more at [http://tinify.com](http://tinify.com).
## Documentation
[Go to the documentation for the .NET client](https://tinypng.com/developers/reference/dotnet).
## Installation
Install the API client:
```
Install-Package Tinify
```Or add this to your `project.json`:
```json
{
"dependencies": {
"Tinify": "*",
}
}
```## Usage
```csharp
using TinifyAPI;class Compress
{
static void Main()
{
Tinify.Key = "YOUR_API_KEY";
Tinify.FromFile("unoptimized.png").ToFile("optimized.png").Wait();
}
}
```## Running tests
```
dotnet restore
dotnet test test/Tinify.Tests
```### Integration tests
```
dotnet restore
TINIFY_KEY=$YOUR_API_KEY dotnet test test/Tinify.Tests.Integration
```
Or add a `.env` file to the `/test/Tinify.Tests.Integration` directory in the format
```
TINIFY_KEY=
```## License
This software is licensed under the MIT License. [View the license](LICENSE).