Unpremultiply

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(redirect for convenient searching ** TODO: 'blending' category?)
 
(add documentation)
 
Line 1: Line 1:
#REDIRECT [[External_filters#Averaging.2FLayering.2FMasking]]
+
{{FilterCat4|External_filters|Plugins|Adjustment_filters|Masking}}
{{FilterCat|External_filters|Adjustment_filters|TODO}}
+
{{Filter3
 +
|1=[http://code.google.com/u/jsutinen@gmail.com/ jsutinen], IanB
 +
|2=20121231
 +
|3=[http://forum.doom9.org/attachment.php?attachmentid=13207&d=1356994426 Unpremultiply.zip]
 +
|4=Masking
 +
|5=[http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause]
 +
|6=[http://forum.doom9.org/showthread.php?t=166730 Doom9 Thread]}}
 +
 
 +
== Description ==
 +
AviSynth plugin to convert a premultipled RGB32 clip to straight matted alpha. AviSynth's [[Overlay]]() function requires straight matted input and will product artifacts if given a premultiplied clip. This plugin performs the appropriate conversion on the alpha channel to prevent this.
 +
 
 +
Eyeon Fusion is known to only produce premultiplied RGBA videos as well as improperly configured versions of Adobe After Effects. Other video compositing solutions may also suffer the same issue.
 +
<br>
 +
<br>
 +
== Requirements ==
 +
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/ greater]
 +
* Supported color formats: [[RGB32]]
 +
<br>
 +
== [[Script variables|Syntax and Parameters]] ==
 +
:{{Template:FuncDef|Unpremultiply (clip)}}
 +
<br>
 +
::{{Par2| |clip| }}
 +
:::Input clip to be unpremultiplied. Input clip must be RGB32, also known as RGBA. All other input types should fail with an error message.
 +
<br>
 +
 
 +
== Examples ==
 +
[[AviSource]]("RGB32OverlayClip.avi")
 +
Unpremultiply()
 +
<br>
 +
== Changelog ==
 +
Version      Date(D/M/Y)      Changes<br>
 +
20121231      31/12/2012      - The bottom row and right column of the lookup table were not being initialised.<br>
 +
20121227      27/12/2012      - Fix a rookie mistake in not clamping the intermediate results between 0 and 255.
 +
                                - Also changed to uses a fast 65K lookup table instead of the slow in place idiv's.<br>
 +
20081229      29/12/2008      - Initial release.
 +
<br>
 +
== Archived Downloads ==
 +
{| class="wikitable" border="1"; width="600px"
 +
|-
 +
!!width="100px"| Version
 +
!!width="150px"| Download
 +
!!width="150px"| Mirror
 +
|-
 +
!20121231
 +
|[http://forum.doom9.org/attachment.php?attachmentid=13207&d=1356994426 Unpremultiply.zip]
 +
|N/A
 +
|-
 +
!20081229
 +
|[http://avisynth-unpremultiply.googlecode.com/files/Unpremultiply-20081229.zip Unpremultiply-20081229.zip]
 +
|[http://web.archive.org/web/20160116193807/https://avisynth-unpremultiply.googlecode.com/files/Unpremultiply-20081229.zip Unpremultiply-20081229.zip]
 +
|}
 +
<br>
 +
== External Links ==
 +
*[http://forum.doom9.org/showthread.php?t=168152 Doom9 Forum] - Layer and Overlay operation giving wrong results with RGBA image source
 +
<br>
 +
<br>
 +
-----------------------------------------------
 +
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &larr;'''

Latest revision as of 20:56, 16 January 2016

Abstract
Author jsutinen, IanB
Version 20121231
Download Unpremultiply.zip
Category Masking
License BSD 3-Clause
Discussion Doom9 Thread

Contents

[edit] Description

AviSynth plugin to convert a premultipled RGB32 clip to straight matted alpha. AviSynth's Overlay() function requires straight matted input and will product artifacts if given a premultiplied clip. This plugin performs the appropriate conversion on the alpha channel to prevent this.

Eyeon Fusion is known to only produce premultiplied RGBA videos as well as improperly configured versions of Adobe After Effects. Other video compositing solutions may also suffer the same issue.

[edit] Requirements


[edit] Syntax and Parameters

Unpremultiply (clip)


clip   =
Input clip to be unpremultiplied. Input clip must be RGB32, also known as RGBA. All other input types should fail with an error message.


[edit] Examples

AviSource("RGB32OverlayClip.avi")
Unpremultiply() 


[edit] Changelog

Version       Date(D/M/Y)      Changes
20121231 31/12/2012 - The bottom row and right column of the lookup table were not being initialised.
20121227 27/12/2012 - Fix a rookie mistake in not clamping the intermediate results between 0 and 255. - Also changed to uses a fast 65K lookup table instead of the slow in place idiv's.
20081229 29/12/2008 - Initial release.


[edit] Archived Downloads

Version Download Mirror
20121231 Unpremultiply.zip N/A
20081229 Unpremultiply-20081229.zip Unpremultiply-20081229.zip


[edit] External Links

  • Doom9 Forum - Layer and Overlay operation giving wrong results with RGBA image source




Back to External Filters

Personal tools