npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hypit/volcengine-matting

v0.2.0

Published

Remove the background of a moving portrait when the composition needs the person's silhouette over another picture. The source video determines the performance, duration and dimensions.

Readme

@hypit/volcengine-matting

Remove the background of a moving portrait when the composition needs the person's silhouette over another picture. The source video determines the performance, duration and dimensions.

<import as="matte" from="@hypit/volcengine-matting@1"/>
<matte:Portrait id="cutout" source={performance.video}/>

source is a video Blob from a file declaration, generation or another media operation. cutout.video is the processed video Blob. format="WEBM" is the default; format="MOV" selects a transparent QuickTime output. This interface exposes the model's two transparent formats. The service's flat-background MP4 option is a different output treatment.

Prepare the processed clip for its role

<import as="mediaop" from="@hypit/media-operations@1"/>
<import as="whisperx" from="@hypit/whisperx@1"/>
<import as="semantic" from="@hypit/narrative-temporal@1"/>
<import as="media" from="@hypit/media@1"/>

<time:Clock id="clock" frame-rate="30"/>
<mediaop:Normalize id="cutout-media" source={cutout.video} clock={clock}
  video="primary-moving" audio="default" span-authority="video"/>
<whisperx:Alignment id="opening-alignment" narrative={story}
  segment={story.segment.opening} media={cutout-media.media}
  domain={cutout-media.domain} language="en"/>
<time:Timeline id="speech" clock={clock} end="opening.end">
  <time:Window id="opening" from="start" for={cutout-media.extent}/>
</time:Timeline>
<semantic:Projection id="story-time" narrative={story} timeline={speech.timeline}>
  <semantic:Map alignment={opening-alignment.alignment}
    domain={cutout-media.domain} window={speech.opening}/>
</semantic:Projection>

This excerpt assumes the performance and Script exist. Normalize keeps the transparent picture and prepares the selected embedded audio. WhisperX associates the Script Segment with the media-local domain; Timeline uses its Extent while semantic projection consumes the equal-length domain/Window relation and then discards it. Use cutout-media.media with during={speech.opening} in independent Visual and Audio Clips. Screen position and stack order remain visual choices.

For independently timed footage, normalize cutout.video with audio="none" when its sound is unwanted, then use cutout-media.media in a Visual Clip. No semantic alignment is needed for that overlay. Existing transparency can enter Normalize directly.

For example, this alternative uses the existing program's Timeline and an authored Selection:

<import as="visual" from="@hypit/visual-track@1"/>
<mediaop:Normalize id="overlay-media" source={cutout.video} clock={clock}
  video="primary-moving" audio="none" span-authority="video"/>
<visual:Track id="overlay" timeline={speech.timeline}>
  <visual:Clip media={overlay-media.media} during={example}
    frame={overlay-frame} z="30" fit="contain" treatment={look.visual.overlay}/>
</visual:Track>

The Frame, treatment Recipe and Selection belong to the composition. Add overlay.visual to Film; the Clip's direct z sets its stacking order. The performance underneath continues to supply semantic time.

The same processed clip can serve either role; matting does not choose its Track or timeline. The local media Provider's Transform currently emits opaque MP4. When a clip also needs trimming or retiming, apply that operation before matting, then normalize the cutout for its intended role.

Review motion, hair, hands, translucent edges and the selected speech against the intended background. Reuse cutout.video or the prepared Output through the Run when changing placement, captions or graphics.

Model and Provider

The capability is @hypit/volcengine-matting@1#matte-portrait-video, returning a GeneratedVideoSet. The Portrait Surface publishes its first video as .video. Its model ports are source (one video) and optional format (WEBM or MOV). It takes no generation prompt or duration.

HypiHub Provider maps it to POST /v1/videos with model: "matte-portrait-video", ref_video_url and format. Account availability and credentials belong to the selected Runtime Endpoint. Submission, job polling, collection and Result storage use that Provider's existing video operation.

To select this route explicitly in a Runtime Profile, bind the capability to an existing HypiHub Endpoint:

{
  "bindings": {
    "@hypit/volcengine-matting@1#matte-portrait-video": "hypihub.default"
  }
}

Here hypihub.default is the Endpoint ID from that profile. The Model describes the operation; the Provider translates it to the service; the Endpoint supplies the account and execution settings. No source duration or resolution needs to be copied into the Source or Runtime Profile.

The input and output formats follow Volcengine's portrait-matting reference.