MatthiasLienhard / flowkey_dl

helper to create sheet music from flowkey songs
MIT License
70 stars 15 forks source link

Doesn't do anything meaningful #16

Closed HerrBert233 closed 2 years ago

HerrBert233 commented 2 years ago

I installed the package on Windows, python 3.9, via. pip.

I imported the flowkey_dl module and started a similar pipeline than the command line version would do. (on Windows there are no gui or cli versions)

import flowkey_dl
image, _, _ = flowkey_dl.flowkey_dl("https://flowkeycdn.com/sheets/xxx/300/0.png")
proc_image = flowkey_dl.arange_image(image, "Prelude No. 1 in BWV 846", "Johann Sebastian Bach")
flowkey_dl.save_pdf(proc_image, "sheet.pdf")

Here is the result I get for one example: sheet.pdf

Doesn't look like anything meaningful.

Otherwise the idea of such an app is very much appreciated, love it! Thanks for the work!

You didn't handle the alpha channel properly. You just removed the alpha channel here but the background is black, not white, this breaks everything that follows. The key here is to properly handle the alpha channel, blend it with a white background instead of just removing it.

HerrBert233 commented 2 years ago

Ah no, I got it! Simple fix. Replace imgs.append(patch[:, :, 3]) with imgs.append(255 - patch[:, :, 3]) then it works.

MatthiasLienhard commented 2 years ago

Thanks