OptiPNG.Tool 1.0.9

dotnet tool install --global OptiPNG.Tool --version 1.0.9
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local OptiPNG.Tool --version 1.0.9
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=OptiPNG.Tool&version=1.0.9
nuke :add-package OptiPNG.Tool --version 1.0.9

OptiPNG dotnet tool & MSBuild task

Build

OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information. It also converts external formats (BMP, GIF, PNM and TIFF) to optimized PNG, and performs PNG integrity checks and corrections.

This project packages the optipng utility as a dotnet tool so it can be easily installed, either globally or locally to a project using dotnet tool manifests. Libraries for Windows, Linux, and macOS are provided.

This project also publishes a custom MSBuild task to make it easy to ensure all images are optimized. In order to support deterministic and incremental builds, the MSBuild task follows the read only source tree guidance. As a result, the task will not optimize images on-the-fly, but rather verify the images are optimized and fail the build if not.

Install

Install the tool as a .NET CLI tool like this:

dotnet tool install optipng.tool

Usage

dotnet tool

Run the tool like this:

dotnet optipng [options] files ...

where all arguments are passed directly to the optipng tool.

Using a custom OptiPNG

By default, the tool includes precompiled versions of optipng for Windows, Linux, and macOS operating systems and x86 and amd64/x64 architectures. If one of the packaged versions doesn't work for your platform / architecture, you can put a compatible version on $PATH and the tool will use that version instead. If this happens to you, also file an issue with your platform details so I can provide precompiled versions for popular platforms.

MSBuild task

// TODO

Licenses

OptiPNG available under the zlib license; this code is available under the MIT license.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.9 376 9/15/2023