Esempio n. 1
0
from assets.objects.PyImEdit import PyImEdit

image_name = "bell.png"

edit = PyImEdit()
edit.load_image(image_name)
edit.show_loaded_image()
edit.factor_shrink(xfact=2, yfact=6)
edit.show_canvas()
Esempio n. 2
0
import os
from assets.objects.PyImEdit import PyImEdit

input_dir = "./assets/images/thumbnailer/images_to_apply_thumbnail/"
output_dir = "./assets/images/thumbnailer/output/"

flashdrive_colors = [
    "red", "green", "blue", "yellow", "megenta", "cyan", "white", "black",
    "gray"
]
thumbnails = ["top_rated_seller", "free_shipping"]
flashdrive = PyImEdit()
flashdrive.set_image_input_dir(input_dir)
flashdrive.set_image_output_dir(output_dir)

thumbnail_name = thumbnails[0]
for color in flashdrive_colors:
    flashdrive_name = "flashdrive_{}.png".format(color)
    flashdrive.load_image(flashdrive_name)
    flashdrive.apply_thumbnail((0, 0), thumbnail_name)
    save_name = "{}_thumbnailed".format(flashdrive.get_image_name())
    flashdrive.save(save_name)
from assets.objects.PyImEdit import PyImEdit

input_dir = "./assets/images/super_compose/me/output/"
output_dir = "./assets/images/super_compose/me/output/"

image_name = "LH_super_compose_shiroe50scale5.png"
save_name = "{}black_and_white".format(image_name)

pyim = PyImEdit()
pyim.set_input_dir(input_dir)
pyim.set_output_dir(output_dir)
pyim.load_image(image_name)
pyim.grayscale(method=0)

pyim.save(save_name)