diff options
| author | DH4 | 2017-06-06 04:04:42 -0500 |
|---|---|---|
| committer | DH4 | 2017-06-06 04:04:42 -0500 |
| commit | 6a1deb9b781890f9a62a6f6ce608856c1fc9e720 (patch) | |
| tree | 0075dedde44009c8c7bc73d1687c826e41464b39 | |
| parent | 0d1e7459e1f156eb2ac004ad87636d0bc39fcc6b (diff) | |
Add checkerboard for transpart frames.
| -rw-r--r-- | background.png | bin | 3711 -> 45367 bytes | |||
| -rw-r--r-- | preview_thread.py | 8 | ||||
| -rw-r--r-- | video_thread.py | 8 |
3 files changed, 14 insertions, 2 deletions
diff --git a/background.png b/background.png Binary files differindex 7a33158..fb58593 100644 --- a/background.png +++ b/background.png diff --git a/preview_thread.py b/preview_thread.py index 5116707..04683ae 100644 --- a/preview_thread.py +++ b/preview_thread.py @@ -6,6 +6,8 @@ import core import time from queue import Queue, Empty import numpy +import os +from copy import copy class Worker(QtCore.QObject): @@ -19,6 +21,9 @@ class Worker(QtCore.QObject): self.queue = queue self.core.settings = parent.settings self.stackedWidget = parent.window.stackedWidget + self.background = Image.new("RGBA", (1920, 1080),(0,0,0,0)) + self.background.paste(Image.open(os.path.join(os.path.dirname(os.path.realpath(__file__)),"background.png"))) + @pyqtSlot(str, list) @@ -41,7 +46,8 @@ class Worker(QtCore.QObject): width = int(self.core.settings.value('outputWidth')) height = int(self.core.settings.value('outputHeight')) - frame = Image.new("RGBA", (width, height),(0,0,0,0)) + frame = copy(self.background) + frame = frame.resize((width,height)) components = nextPreviewInformation["components"] for component in reversed(components): diff --git a/video_thread.py b/video_thread.py index ac4162c..e880263 100644 --- a/video_thread.py +++ b/video_thread.py @@ -63,10 +63,16 @@ class Worker(QtCore.QObject): self.bgI += 1 def previewDispatch(self): + background = Image.new("RGBA", (1920, 1080),(0,0,0,0)) + background.paste(Image.open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "background.png"))) + background = background.resize((self.width, self.height)) + while not self.stopped: i = self.previewQueue.get() if time.time() - self.lastPreview >= 0.06 or i[0] == 0: - self._image = ImageQt(i[1]) + image = copy(background) + image = Image.alpha_composite(image, i[1]) + self._image = ImageQt(image) self.imageCreated.emit(QtGui.QImage(self._image)) self.lastPreview = time.time() |
