texturedesign / texturize

🤖🖌️ Generate photo-realistic textures based on source images or (soon) PBR materials. Remix, remake, mashup! Useful if you want to create variations on a theme or elaborate on an existing texture.
GNU Affero General Public License v3.0
706 stars 32 forks source link

Better error reporting for size parameter #38

Closed melonmouse closed 1 year ago

melonmouse commented 2 years ago

Following the example from the readme:

from texturize import api, commands, io

# The input could be any PIL Image in RGB mode.
image = io.load_image_from_file("input.png")

# Coarse-to-fine synthesis runs one octave at a time.
remix = commands.Remix(image)
for result in api.process_octaves(remix, octaves=5):
    pass

# The output can be saved in any PIL-supported format.
result.image.save("output.png")

Fails due to the size not being passed to process_octaves, but the runtime error is not overly clear. I don't know the exact criteria on size, but powers of 2 seem to work well (e.g. size=(512,512)).

Some ideas:

melonmouse commented 1 year ago

Nice work!