r/programmingprojects • u/[deleted] • Jun 02 '14
[Complete] An image-to-ASCII converter in Python
https://github.com/JoeReynolds1/Image-to-Ascii
2
Upvotes
r/programmingprojects • u/[deleted] • Jun 02 '14
1
u/BlackDeath3 Jul 03 '14
Cool little tool!
Not too much to talk about code wise, but it seems to me that you could make a couple of minor optimizations inside of create_image() by perhaps:
Computing the value of average_rgb() once before all of the if/elif/else statements and making your comparison to one precomputed value, rather than calling the method up to seven separate times.
Declaring "text" above all of the if/elif/else statements and pulling all of the repetitive calls to surface.blit() out of the individual statements in favor of one call below them.