texturize
texturize copied to clipboard
Better error reporting for size parameter
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:
- update the example in README.md so a size is passed in
- and/or set a sensible default when size is not passed
- and/or make size non-optional and fail explicitly when its value is wrong