473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

converting a text file to image

i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
Jun 27 '08 #1
2 6804
On Jun 20, 9:15*am, jimgardener <jimgarde...@gmail.comwrote:
i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning *and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
Do you have a text file (toto.txt) and you want to render it as an
image ?
Never done that but my first thought is to use PIL (http://
www.pythonware.com/products/pil/).

Examples:
http://aspn.activestate.com/ASPN/Coo.../Recipe/483756
http://blog.foozia.com/blog/2007/nov...o-template-tag
Jun 27 '08 #2
jimgardener wrote:
i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
You can use PIL to do this. I have a small class that I wrote that does this
using PIL. Supports background TIF image (e.g. form). I used it to generate
TIFF images of a client's Invoices for them. If you are interested, drop me an
email and I'll forward it to you. It does also depend on netpbm because PIL
doesn't support outputting of compressed TIFF images.

-Larry
Jun 27 '08 #3

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

Similar topics

1
by: ketulp_baroda | last post by:
Hi I am storing the attachments in files on the server.User can see all the attachments & view any of them. My application shows the attachment correctly for file which have no spaces in their...
8
by: iyuen | last post by:
I'm having problems with converting a byte array to an image object~ My byte array is an picture in VB6 StdPicture format. I've used propertybag to convert the picture into base64Array format in...
0
by: Mark Allen | last post by:
Hello, I am creating an RTF document server side for a report. However I am having problems converting images into the required RTF format. I am converting the image into a string (binary)...
9
by: Tim | last post by:
Since rtf files cause so many troubles, i.e., allow the users to download the files, slow loading, incompatible with other browser, and so on. Do you think I should convert them to JPEG files to...
4
by: Beginner | last post by:
How do I convert JPEG images to binary files in ASP.NET? Please advice. Thanks.
2
by: Laurent Navarro | last post by:
Hello, I am using a library which returns a byte containing RAW data, ie all pixels' color values coded in a byte array without header. I would like to save those data into a JPEG file so I...
12
by: Dudely | last post by:
I want to be a good little author and use CSS. Therefore, I'm attempting to convert my tables to the equivalent CSS. Unfortunately, I can't reproduce the same results. Can someone take a look...
4
by: Newbie | last post by:
Does anybody know of a vb.net callable library that will allow me to convert text into a (preferably) .JPG file or .GIF file?
5
by: almurph | last post by:
RE: Tryign to convert Graphics object to a bitmap Hi, Hope you can help me with this. I have to open a file and add some text to it and then display it. So I create an Image object then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.