mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
moved composite_images to pype's tvpaint.lib
This commit is contained in:
parent
9baf9aaf2b
commit
a710d12c5f
2 changed files with 18 additions and 16 deletions
17
pype/hosts/tvpaint/lib.py
Normal file
17
pype/hosts/tvpaint/lib.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from PIL import Image
|
||||
|
||||
|
||||
def composite_images(
|
||||
input_image_paths, output_filepath, scene_width, scene_height
|
||||
):
|
||||
img_obj = None
|
||||
for image_filepath in input_image_paths:
|
||||
_img_obj = Image.open(image_filepath)
|
||||
if img_obj is None:
|
||||
img_obj = _img_obj
|
||||
else:
|
||||
img_obj.alpha_composite(_img_obj)
|
||||
|
||||
if img_obj is None:
|
||||
img_obj = Image.new("RGBA", (scene_width, scene_height), (0, 0, 0, 0))
|
||||
img_obj.save(output_filepath)
|
||||
|
|
@ -4,25 +4,10 @@ import tempfile
|
|||
|
||||
import pyblish.api
|
||||
from avalon.tvpaint import lib
|
||||
from pype.hosts.tvpaint.lib import composite_images
|
||||
from PIL import Image
|
||||
|
||||
|
||||
def composite_images(
|
||||
input_image_paths, output_filepath, scene_width, scene_height
|
||||
):
|
||||
img_obj = None
|
||||
for image_filepath in input_image_paths:
|
||||
_img_obj = Image.open(image_filepath)
|
||||
if img_obj is None:
|
||||
img_obj = _img_obj
|
||||
else:
|
||||
img_obj.alpha_composite(_img_obj)
|
||||
|
||||
if img_obj is None:
|
||||
img_obj = Image.new("RGBA", (scene_width, scene_height), (0, 0, 0, 0))
|
||||
img_obj.save(output_filepath)
|
||||
|
||||
|
||||
class ExtractSequence(pyblish.api.Extractor):
|
||||
label = "Extract Sequence"
|
||||
hosts = ["tvpaint"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue