Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvements #1

Open
sergiocampama opened this issue Jul 21, 2019 · 0 comments
Open

Performance improvements #1

sergiocampama opened this issue Jul 21, 2019 · 0 comments

Comments

@sergiocampama
Copy link

Hi! Thanks for this project, it's really cool! I'm using the asciiart code to generate images to print on an Okidata ML184 Turbo, and we've had really good results since we can use the overstrike technique.

To generate the text file, I'm using a digital ocean node that accepts images sent form an iOS app, and these nodes are really not powerful at all, taking around 2 minutes to generate a single text file.

Since I don't understand math at all, it's kinda hard for me to detect which places in the code can be substituted to achieve comparable results. I did notice that from those 2 minutes, 80% of the time is spent on the np.linalg.norm loop since for a 60x80 char image, it runs a total of 19,660,800 times (60x80x4096 which is the size of the overstrike json file).

I tried some optimizations on the generated json file instead. For example, if "AB" has already been processed, then don't process "BA" as well. This ~halved the json file and the time it takes to generate artwork. I saw that "AB" might not be exactly the same as "BA", but I attribute it to artifacts in the origin jpeg or in the ASR machine that printed it. What do you think?

Overall, this is an amazing project, and has allowed me to try some cool ideas on my own. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant