Skip to content

Commit

Permalink
v1.0.6 - Axe the color space inheritance
Browse files Browse the repository at this point in the history
It can cause issues as some values were being guessed depending on the input clip's colorspace so it's best to leave it up to the user to convert instead.
  • Loading branch information
rlaphoenix committed Nov 29, 2019
1 parent 265eabc commit e8bdbbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="vsgan",
version="1.0.6-post1",
version="1.0.7",
author="PRAGMA",
author_email="[email protected]",
description="VapourSynth GAN Implementation using RRDBNet, based on ESRGAN's implementation",
Expand Down
13 changes: 7 additions & 6 deletions vsgan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ def run(self, clip, chunk=False):
core.std.StackVertical([results[0], results[1]]),
core.std.StackVertical([results[2], results[3]])
]) if chunk else results[0]
# Convert back to the original color space
if original_format.color_family != buffer.format.color_family:
if original_format.color_family == vs.ColorFamily.RGB:
buffer = mvsfunc.ToRGB(buffer)
if original_format.color_family == vs.ColorFamily.YUV:
buffer = mvsfunc.ToYUV(buffer, css=original_format.name[3:6])

# VSGAN used to convert back to the original color space which resulted
# in a LOT of guessing, which was in-accurate and may not be efficient
# depending on what the user is doing after running VSGAN, so in all
# versions after 1.0.6-post1 we return it in the colorspace the GAN
# provides which is always RGB24.

# return the new frame
return buffer

Expand Down

0 comments on commit e8bdbbc

Please sign in to comment.