transmute is an endorsement package that re-exports four Dart clients behind a
single dependency. Add transmute when you want one import surface for document
text extraction, image processing, GIF tooling, and FFmpeg-style media work.
It currently exports:
tikafor Apache Tika document text extractionimage_magickfor ImageMagick image inspection and transformsgifsiclefor GIF inspection, optimization, merging, and frame operationsmpegforffmpegandffprobeprocess access, probing, transcoding, remuxing, and frame extraction
transmute does not bundle those native tools for you. It re-exports the Dart
APIs, and the host machine or container still needs the matching system
dependencies installed.
dart pub add transmuteThen import the umbrella package:
import 'package:transmute/transmute.dart';Because transmute re-exports the underlying libraries directly, you use the
same classes and methods documented in each package README:
TikaClientfor extracting text from PDFs, DOCX files, and other supported documents through Apache TikaImageMagickClientfor format inspection, resize, crop, convert, rotate, flip, and metadata strippingGifsicleClientfor GIF metadata, optimization, resizing, merging, exploding into frames, and frame extractionMpegClientforffmpegandffprobeversion checks, probing, transcoding, remuxing, and thumbnail extraction
import 'package:transmute/transmute.dart';
Future<void> main() async {
TikaClient tika = TikaClient();
ImageMagickClient images = ImageMagickClient();
GifsicleClient gifs = GifsicleClient();
MpegClient media = MpegClient();
String text = await tika.readText(
documentPath: '/tmp/report.pdf',
);
await images.resize(
inputPath: '/tmp/input.png',
outputPath: '/tmp/output.webp',
width: 1200,
onlyShrink: true,
format: 'webp',
);
await gifs.optimize(
inputPath: '/tmp/input.gif',
outputPath: '/tmp/output.gif',
maxDimension: 512,
lossy: 80,
);
await media.extractFrame(
inputPath: '/tmp/video.mov',
outputPath: '/tmp/thumbnail.png',
position: const Duration(seconds: 1),
width: 320,
height: 180,
);
print(text);
}To use all four re-exported clients, your runtime environment needs:
- Java plus Apache Tika available as
tikaonPATH, or a downloadedtika-app.jarused withTikaClient.jar(...) - ImageMagick available as
magick, or the legacyconvertandidentifycommands gifsicleonPATHffmpegandffprobeonPATH
If one of those binaries is missing, the corresponding client will fail when it tries to launch the process.
This is a copy-paste friendly Debian or Ubuntu style setup that installs
everything transmute needs in one image.
FROM dart:stable
ARG TIKA_VERSION=3.3.0
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
default-jre-headless \
ffmpeg \
gifsicle \
imagemagick \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /opt/tika \
&& curl -fsSL "https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-app-${TIKA_VERSION}.jar" \
-o /opt/tika/tika-app.jar \
&& printf '#!/bin/sh\nexec java -jar /opt/tika/tika-app.jar "$@"\n' > /usr/local/bin/tika \
&& chmod +x /usr/local/bin/tika
WORKDIR /app
COPY pubspec.* ./
RUN dart pub get
COPY . .
CMD ["dart", "run"]That setup gives you:
tikathrough a small wrapper script aroundjava -jar /opt/tika/tika-app.jarmagickfor ImageMagickgifsicleffmpegandffprobe
If you would rather skip the wrapper script, keep the jar on disk and use:
TikaClient tika = TikaClient.jar(
jarPath: '/opt/tika/tika-app.jar',
);Optional verification inside the container:
tika --version
magick -version
gifsicle --version
ffmpeg -version
ffprobe -versionHomebrew is the simplest way to install the full stack locally:
brew install tika imagemagick gifsicle ffmpegVerify the installs:
tika --version
magick -version
gifsicle --version
ffmpeg -version
ffprobe -versionIf your ImageMagick install exposes the legacy commands, these may also be available:
convert -version
identify -versionAfter that, the default constructors work as expected:
TikaClient tika = TikaClient();
ImageMagickClient images = ImageMagickClient();
GifsicleClient gifs = GifsicleClient();
MpegClient media = MpegClient();transmute is intentionally thin. For the full API surface, detailed examples,
and package-specific setup notes, see:
transmuteis best suited to server-side Dart, CLI apps, Docker containers, and macOS or Linux environments where those native tools can be installed.gifsiclecan also be pointed at a Docker-backed command prefix if you prefer to run that tool throughdocker run ... gifsicleinstead of a local binary.mpegsupports custom executable paths, environment variables, and working directories when your deployment environment needs non-default process wiring.