fpng for VapourSynth
This is a small plugin which allows fpng to be used with VapourSynth.
The motivation for this plugin was to dump frames of a VapourSynth script to PNGs faster than was possible with imwri.
Installation
The plugin is available on PyPI and can be installed with:
python -m pip install vsfpng
Usage
Python Helper
The raw plugin only writes frames when they are requested. This complicates the most common scenario where a user wants to dump all frames from a clip. To make dumping easier, a python helper is included and can be invoked from your script. See below example.
To get progress feedback, install rich.
def dump(
clip: vs.VideoNode | tuple[vs.VideoNode, vs.VideoNode],
output_directory: str | Path,
filename_template: str = "frame_%d",
first_num: int = 0,
overwrite: bool = True,
compression: Compression = Compression.SLOW,
) -> None:
"""
Dump all frames of a clip to .png files.
Args:
clip: A single input clip if no transparency is needed. Otherwise
a tuple of (clip, alpha) where alpha is a gray clip with the same
dimensions.
output_directory: Where to dump PNGs. Will attempt to create the
directory if it doesn't already exist.
filename_template: A printf style template for the filename. For
example "frame_%d" or "%06d". Suffix will always be .png and does
not need to be explicitly specified.
first_num: The number to start counting from. Useful, for example, to
preserve frame numbers from a source clip if the input clip has
been trimmed.
overwrite: If existing files should be overwritten. When set to False,
existing files are left untouched, and no exception is raised.
compression: The fpng compression level. The default is fine for most
purposes, but can be set if other speed and size trade-offs are
desired.
"""
Example
example.py
import vapoursynth as vs
clip = vs.core.bs.VideoSource("example.mkv")
# Set output so clip can be previewed or used with vspipe normally
clip.set_output()
# Only dump if the script is invoked directly
if __name__ == "__main__":
from vsfpng import dump
dump(clip, "./output")
output
$ vspipe example.py --info
Output Index: 0
Type: Video
Width: 1920
Height: 1080
Frames: 38072
FPS: 60/1 (60.000 fps)
Format Name: YUV420P8
Color Family: YUV
Alpha: No
Sample Type: Integer
Bits: 8
SubSampling W: 1
SubSampling H: 1
$ python example.py
Dumping... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:01:49
Plugin Documentation
Usage is similar to imwri.Write() with ImageMagick options replaced with fpng options.
.. function:: Write(clip clip, string filename[, int firstnum=0, int compression=1, bint overwrite=False, clip alpha])
:module: fpng
Write will write each frame to disk as it's requested. If a frame is never
requested it's also never written to disk.
Parameters:
clip
Input clip. Only RGB24 is supported.
filename
The filename string must have one or more frame number substitutions.
The syntax is printf style. For example "image%06d.png" or
"/images/%d.png" is common usage.
firstnum
The first image number in the sequence to write.
compression
Matches fpng flags which are:
0 - fast compression
1 - slow compression (smaller output file)
2 - uncompressed
overwrite
Overwrite already existing files. This option also disables the
requirement that output filenames contain a number.
alpha
A grayscale clip containing the alpha channel for the image to write.
Apart from being grayscale, its properties must be identical to the
main *clip*.
Vendored Dependencies
Some dependencies are directly copied into the src/ directory from their respective projects. It is the author's understanding that this usage is compatible with the applicable licenses.
From fpng fetched 2022-04-30
fpng.hfpng.cpp
From libp2p fetched 2022-04-30
p2p.hp2p_api.hp2p_api.cppv210.cpp
From vs-imwri fetched 2022-04-30
vsutf16.h- Several methods within
plugin.cppalso directly come fromimwri.cpp
vapoursynth as a submodule for
VapourSynth4.h
Metadata
Release files for vsfpng 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vsfpng-1.3.tar.gz | 642.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| vsfpng-1.3-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| vsfpng-1.3-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 | Details |
| vsfpng-1.3-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 | Details |
| vsfpng-1.3-py3-none-macosx_15_0_x86_64.whl | Python 3 | none | macOS 15.0+ x86-64 | Details |
| vsfpng-1.3-py3-none-macosx_15_0_arm64.whl | Python 3 | none | macOS 15.0+ ARM64 | Details |
Total release size: 1.2 MB
Release files / vsfpng-1.3.tar.gz
| Download URL | vsfpng-1.3.tar.gz |
|---|---|
| Size | 642.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97ca92ed95b50ec9c5f559a8d5a8eeb2121953320fc99f605d18d076c87cff44
|
|
BLAKE2b-256 checksum How to use checksums |
c5c4b6ee1a9aed53fa2276609a3eab44c90df00691896d70463386394d248a61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / vsfpng-1.3-py3-none-win_amd64.whl
| Download URL | vsfpng-1.3-py3-none-win_amd64.whl |
|---|---|
| Size | 219.2 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
74429b3a566add32cd0f585e2bf3e1d6d4baaf11158231659629d9b7bd27e456
|
|
BLAKE2b-256 checksum How to use checksums |
6ea7672e60904647fdfd4d3f3b859bd20e5bae23d00bfb8e55508a21cc669386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / vsfpng-1.3-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | vsfpng-1.3-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 96.1 kB |
| Tags | Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
3bff45e63fc1e13bb787dc946408867610958d8fdaa5e30d29151440b0f4df81
|
|
BLAKE2b-256 checksum How to use checksums |
10837e952b64155d6300b0713393f94f4672895412306721f50c8ead37abbf64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / vsfpng-1.3-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | vsfpng-1.3-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 98.7 kB |
| Tags | Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
3ea08f3a20f105ad7b31f41ff8392061e25437ead1ae9ba119838bab90920b62
|
|
BLAKE2b-256 checksum How to use checksums |
336a2cf91696f9e426db79010384c28f1c03efc3b346dc09e29a84cd9273b895
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / vsfpng-1.3-py3-none-macosx_15_0_x86_64.whl
| Download URL | vsfpng-1.3-py3-none-macosx_15_0_x86_64.whl |
|---|---|
| Size | 74.9 kB |
| Tags | Python 3 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
f581acf584de182fd114765caedfa9df7d51d854ea1ec8fef33c41298dafbd91
|
|
BLAKE2b-256 checksum How to use checksums |
712b261ea2c157ee6f942010137b9bc3909e9ef9101a7adad01bacd7fbe770fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / vsfpng-1.3-py3-none-macosx_15_0_arm64.whl
| Download URL | vsfpng-1.3-py3-none-macosx_15_0_arm64.whl |
|---|---|
| Size | 68.7 kB |
| Tags | Python 3 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
55a3a31c418a95343c0ebe859dd5d1c84874c23d0e206a23b05df30a90361228
|
|
BLAKE2b-256 checksum How to use checksums |
0ad5de92f9d83fb275a99d72bac57f308aca94065e071188b05a4999e7349f54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency log