Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-03-2009, 03:55 PM   #1
Senior Member
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Convert text to image?

I would like to convert a lot of text to jpeg images.

I tried it from the command line using convert:
echo "This is some text to test if imagemagick is useable for converting text to image" | convert -page 500x360+0+0 -font Helvetica -style Normal -background none -undercolor white -fill black -pointsize 22 text:- +repage -background white -flatten text_box_trimmed.png

I supposed that the above command would wrap long text lines, but it did not. Long lines were truncated, instead.

I also tried it manually, by first converting the text to pdf by OpenOffice, then converting pdf to jpg by imagemagick.

This was also prevented by convert: it inserted a large blank area above the text, when converting it to jpeg. It seemed as if convert did not like the landscape-oriented pdf page, so it made a square-like image of it by inserting the blank area.

Is there a way to efficiently convert text to jpeg at the present immature stage of softwares on linux?

Finally I succeded with the "inferior" method through pdf (using the -trim option to remoe the blank area). But the quality of the text on the resulting image is really bad this way. It just cannot be compared to the method when the conversion is made from text directly.

Last edited by J_Szucs; 04-03-2009 at 06:23 PM.
Old 04-03-2009, 06:49 PM   #2
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
I've never done this, but if the whole problem with imagemagick is that it doesn't wrap lines, you can do that previously with an external tool, can't you?
Old 04-03-2009, 07:03 PM   #3
Senior Member
Registered: Jun 2008
Posts: 1,820

Rep: Reputation: 229Reputation: 229Reputation: 229
A guess...

Doesn't OpenOffice Draw allow saving documents as jpeg? You might have to go by way of Writer, if you could get the text composed there in the form you want.

Last edited by thorkelljarl; 04-03-2009 at 07:06 PM.
Old 04-04-2009, 11:34 AM   #4
Registered: Oct 2004
Location: Stoney Stanton - England
Distribution: openSuse tumbleweed
Posts: 329

Rep: Reputation: 33
The way I do this is to type the text using koffice, then use ksnapshop to picture the screen and then edit the jpg. Not a very neat way but it works.
Old 04-04-2009, 02:22 PM   #5
Senior Member
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Originally Posted by i92guboj View Post
I've never done this, but if the whole problem with imagemagick is that it doesn't wrap lines, you can do that previously with an external tool, can't you?
The fold command comes to mind.

echo "blah blah blah" | fold -w a_number
As ever, 'man fold' for more info.
Old 04-04-2009, 02:48 PM   #6
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
i would just have OO save the text as a pdf then open that pdf in gimp and save that as a *.jpg ( i would use png , but that is just me )
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Howto Convert Vmware Image to Virtualbox Image LXer Syndicated Linux News 0 03-11-2009 09:01 AM
Convert dd image of XP to ghost image ? frenchn00b Linux - General 1 03-08-2008 09:57 AM
Steps needed to convert multiple text files into one master text file jamtech Programming 5 10-07-2007 11:24 PM
convert image to text? tramni1980 Linux - Desktop 4 12-18-2006 03:29 PM
convert image.png image.jpg changing colours MikeyCarter Linux - Software 1 11-17-2006 10:16 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration