Image to Variable Width ASCII Art Conversions 9

*** Variable width conversions were added in version 0.6.0, Original post follows: ***

Good news: The idea I had to do variable width ASCII art works.
Bad news: It’s ridiculously slow and totally unworkable. Currently takes around 5 minutes to do a small image.

Edit – Down to about 10 seconds to do the conversion. Still not fast enough but it’s getting there.
Edit2 – Now 0.25 seconds, and I can still optimise the design a lot more.

Just to show I’m not making this up:
First variable width conversion
It’s in Microsoft Sans Serif 8pt, and the aspect ratio isn’t right, but you get the idea.

9 thoughts on “Image to Variable Width ASCII Art Conversions

  • Dwayne

    Very nice results, as well. Okay, so I guess that is over for variable width AscGen..? 🙁

    Thanks for giving it a try, even if it doesn’t get implemented.

  • Dwayne

    I hope you can get the processing time down, that looks awesome! I think 15 seconds or so for a large generation might be usable.

  • Jonathan

    Just changed the code to use a StringBuilder instead of storing it directly in the textbox, and it now takes around 10 seconds to convert that same image. It’s still not good enough though. I need to have a rethink about how I’m doing this.

  • Dwayne

    Cool, I’m pretty excited about the feature! 🙂

    10 seconds is kind of workable, although only in the sence that colour ASCII converters take about that length. You couldn’t work with the brightness and contrast but it’s quick enough to give basic gens.

  • Jonathan

    It’s now down to about 0.25 seconds. Not that I optimised it, I just realised that I was still refreshing the RichTextBox for every character. 😳

  • Dwayne

    This is not a complaint, in fact I quite like the `jagged’ edge, but I was just curious whether say you were to do a flag, for instance, where a top half of the image is designated one colour and the bottom another. As the colours are all pretty similiar, would that create an effect at the side of the image where the bottom half or the top half extends a little further out? It might be a bit distracting. I won’t make an issue of it anyway until I can play around with it when you decide to incorporate what will be an amazing feature.

  • Jonathan

    I’ll get around to dealing with the edge eventually. It probably won’t ever be exact, but I think I’d rather have it be a few pixels over/under then to just choose the last character because it fits.

    Finally ran a profiler to see what was taking all the time. I’ve gotten conversion time down to 60ms (0.06 seconds?) and I still haven’t improved the design yet. I really need to stop updating controls in loops. 😳

  • Dwayne

    That’s perfectly understandable to overlook things, maybe even pivotal. I’m sure the feature will be totally awesome!

    Ideally, it would be nice to have a perfectly flat egde, but not if it meant redesigning anything or sacrificing any of the quality of the conversion. The instance that I described probably won’t even occur too often, so I shouldn’t have even bothered really mentioning it at this stage.

    Your program’s going to rock!! 🙂

Comments are closed.