473,699 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

aalib-wrapper for python?

Hello List,

Maybe someone can help me with some hobby project...

I'm currently searching for a way to convert photos to assci-art files ready
to print out, which means to a postscript or pdf file, which contains many
many letters in some non-proportional font which together look like the
photo. Currently I'm using

gimp (for looking up image size)
gnumeric (for line length calculations)
asciiview (load image and create ascii text from it)
enscript (for conversion from text to ps).

But that's cumbersome, so I'd love to put it all into an python script (as
python is my favourite scripting language:). Replacing gimp, gnumeric and
enscript is not a problem (thanks to pil and reportlab), but I couldn't
find a way to access aalibs funtionality from within python. Is there such
a wrapper or do I have to write ony myself? I'm not a C expert so I'd love
to avoid that. And can anyone estimate how much work it would be?

Maybe it helps if I tell you more precisely I want to do in that script:

- load image with pil and get its size
- for a chosen font (let's say courier 5) calculate how many characters
fit onto a sheet of paper (let's say with size a4) horizontally and
vertically
- from that and the images aspect ration calculate line length and number
of lines of the resulting ascii image
- feed the image to aalib (I wonder how to do that) and get the ascii data
back (tuple of strings?)
- use reportlab to create an pdf file containing the ascii data centered to
the middle (if line length or number of lines don't fill up the page
completely)

And those I want to print out on quality paper and hang them on my wall :)

(May seem strange to you, but I like it! I've got the linux penguin on a a3
sheet of paper on my office's door and feel happy everytime I come to
work...)

Maybe someone has an idea on anything of the above. Any help or ideas would
be greatly appreciated!

Karsten
Jul 18 '05 #1
0 1260

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1406
by: Ebi | last post by:
I want to know the "Graphic functions for DOS" in borland C++ 5.0 Do you know any Graphic functions for DOS in it? thanks a million!
8
2384
by: Thomas Stegen | last post by:
I have written a code generator. To be more specific it is a code generator generator. As in a generator that generates code generators. If you run the generator on its own source code you get a code generator generator code generator. If you run it on some other non-generator code you get a code generator generator generator. Watch your bracketisation in all that. The idea is to generate code which generate code which looks exactly like...
3
1335
by: wdandrews1 | last post by:
/* Remove.c ** Usage: remove < In_file Out_file (using redirection) */ #include <stdio.h> #include <stdlib.h> int main(void) { char c; int space = 0;
151
8042
by: istillshine | last post by:
There are many languages around: C++, JAVA, PASCAL, and so on. I tried to learn C++ and JAVA, but ended up criticizing them. Is it because C was my first programming language? I like C because, comparatively, it is small, efficient, and able to handle large and complex tasks. I could not understand why people are using and talking about other programming languages.
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.