TianZerL / pyanime4k

An easy way to use anime4k in python
MIT License
116 stars 17 forks source link

Running error on archlinux #7

Closed zerollzeng closed 4 years ago

zerollzeng commented 4 years ago

when I import pyanime4k, following error occurs: OSError: /usr/lib/libpango-1.0.so.0: undefined symbol: hb_buffer_set_invisible_glyph did I miss something? here are some information that maybe helpful:

$ pacman -Qn harfbuzz pango harfbuzz 2.6.8-2 pango 1:1.44.7+11+g73b46b04-1

zerollzeng commented 4 years ago

move to ubuntu, problem solved

TianZerL commented 4 years ago

They are both dependencies of GTK2.0, try to reinstall or upgrade libgtk2.0.
And I testd it in manjaro Linux, it was fine, but my harfbuzz version is 2.6.7-1, maybe there are some APIs changed in 2.6.8.

zerollzeng commented 4 years ago

yeah that might be the reason, but I don't want to break my system dependency, so I moved to ubuntu on server.

and do you know how to control the upscale ratio? by default it's 2x, how can I make to to 4x or 8x directly?

# pathlib.Path path objects are recommended instead of strings
import pathlib

# import pyanime4k library
import pyanime4k

# display single image upscaled with Anime4KCPP
pyanime4k.show_upscaled_image(pathlib.Path('image1.png'))

# upscale a single image
pyanime4k.upscale_images(pathlib.Path('image1.png'))

# upscale a list of images
images = [
    pathlib.Path('image1.png'),
    pathlib.Path('image2.png')
]

pyanime4k.upscale_images(
    inpuat_paths=images,
    output_path=pathlib.Path('./output')
)

btw I noticed a spell error on inpuat_paths=images, please correct it :smile:

TianZerL commented 4 years ago

This spell error is only in readme, I will correct it.

and do you know how to control the upscale ratio?

By default: parameters: Parameters = Parameters()

you can pass in your own parameters:

parameters = ac.Parameters()
# enable HDN for ACNet
parameters.HDN = True
# 4x upscale
parameters.zoomFactor = 4
pyanime4k.upscale_images(pathlib.Path('image1.png'), parameters = parameters)

Or you can use AC class directly, see readme