Closed alexjc closed 1 year ago
@alexjc i have more then 2 images. I want to mashup and create texture. But the code is not writhing the resultant file. I even try with 2 image files but it didn't work (May be I m wrong). Just guide me how to use mashup command in order to merge input images. Thanks. The code below is given on git-hub but its not working.
from texturize import api, commands, io
from PIL import Image
# newsize = (512, 512)
# # Opens a image in RGB mode
# The input could be any PIL Image in RGB mode.
# io.load_image_from_file("/home/casper/Desktop/point_clouds/pre_tex.png")
sources = [
io.load_image_from_file("/home/casper/Desktop/point_clouds/texturize/tex1.png"),
io.load_image_from_file("/home/casper/Desktop/point_clouds/texturize/tex2.png")
# io.load_image_from_file("/home/casper/Desktop/point_clouds/texturize/tex3.png"),
# io.load_image_from_file("/home/casper/Desktop/point_clouds/texturize/tex4.png")
]
# Only process one octave to retain photo-realistic output.
mashup = commands.Mashup(sources)
for result in api.process_octaves(mashup, octaves=5):
pass
# The output can be saved in any PIL-supported format.
result.save("./output.png")
Mashing up grass and dirt sometimes produces low-quality or even buggy results.
mashup_dirt5_grass6
(left: bug on first-run, right: expected on second-run)mashup_dirt8_grass7
(left: quality=2 lower quality than others, right: quality=4 as expected)EDIT: It may be that the second row (low quality matches) is a result of recovering from the first row (gradients exploded).