Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd April 2023, 13:59   #1  |  Link
SilSinn9801
Chiptuner & VapourSynther
 
SilSinn9801's Avatar
 
Join Date: Mar 2019
Location: Scarlet Devil Mansion, Gensōkyō
Posts: 52
core.resize does not resize alpha mask when applied to transparent image clips

When I import a transparent PNG image with core.ffms2.Source(filepath,alpha=True) & then apply to it resize.Point (or any other core.resize function), only the base RGB components get resized; the alpha component does not get resized at all (std.PropToClip(clip, prop='_Alpha') returns a mask with same dimensions as the original file rather than same dimensions as the resized image clip.
Is there some way to get the alpha to resize to same dimensions as the original?
__________________
SilSinn9801 a.k.a. Silent Sinner in Scarlet
Discord: silsinn9801
Matrix: silsinn9821:matrix.org
YouTube: https://youtube.com/SilentSinnerInScarlet
ニコニコ動画: https://nicovideo.jp/user/68029427
SilSinn9801 is offline   Reply With Quote
Old 2nd April 2023, 15:10   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,370
Quote:
Originally Posted by SilSinn9801 View Post
When I import a transparent PNG image with core.ffms2.Source(filepath,alpha=True) & then apply to it resize.Point (or any other core.resize function), only the base RGB components get resized; the alpha component does not get resized at all (std.PropToClip(clip, prop='_Alpha') returns a mask with same dimensions as the original file rather than same dimensions as the resized image clip.
Is there some way to get the alpha to resize to same dimensions as the original?
The alpha channel is handled separately. If you are applying some transform to the RGB components, you need to apply the same to alpha channel

eg
Code:
clip = core.ffms2.Source(r'PATH\img.png', alpha=True)
alpha = core.std.PropToClip(clip)

clip = core.resize.Point(clip, width=640, height=360)
alpha = core.resize.Point(alpha, width=640, height=360)

#output RGB + A
clip.set_output(alpha=alpha)
poisondeathray is offline   Reply With Quote
Reply

Tags
alpha, ffms2, mask, resize, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.