change text image into 300 dpi

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
ratneshsoni
Posts: 38
Joined: 2010-12-14T03:56:10-07:00
Authentication code: 8675308

change text image into 300 dpi

Post by ratneshsoni »

hello
I want to change the text image into 300 dpi while it is creating, mean to say that is there is any way to generate the text image into 300 dpi when it is creating. I am using fred's script to generate the text image and i also want this in resize the images.
Default is 72 DPI. Or there is any way to set 300 dpi as default dpi.
Please help me ASP.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: change text image into 300 dpi

Post by fmw42 »

try

texteffect .... MIFF:- | convert - -density 300 outputimage

or modify the script to add -density 300 just before the $outfile
ratneshsoni
Posts: 38
Joined: 2010-12-14T03:56:10-07:00
Authentication code: 8675308

Re: change text image into 300 dpi

Post by ratneshsoni »

i try the below code but it not work.
./texteffect.sh -t 'TEST NAME' -f 'images/ttf_files/impact.ttf' -p 24 -c '#000000' -b transparent -u none -density 300 test1.png
if i change the DPI after generating text it distort the image that i dont want. Please Help me i want to specify the density when i generating text
Please help me ASP
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: change text image into 300 dpi

Post by fmw42 »

ratneshsoni wrote:i try the below code but it not work.
./texteffect.sh -t 'TEST NAME' -f 'images/ttf_files/impact.ttf' -p 24 -c '#000000' -b transparent -u none -density 300 test1.png
if i change the DPI after generating text it distort the image that i dont want. Please Help me i want to specify the density when i generating text
Please help me ASP
You have to open the texteffect script file and use a text editor to add -density just before the $outfile at the end of the file.

Note that png only allows metric density so 300 is not dots per inch but dots per centimeter or (meter).

Change the following:


if [ "$rotation" != "0" -a "$rotation" != "0.0" -a "$rotation" != ".0" ]
then
convert $tmpA0 -background "$bc" -rotate $rotation $outfile
else
convert $tmpA0 $outfile
fi

exit 0


to



if [ "$rotation" != "0" -a "$rotation" != "0.0" -a "$rotation" != ".0" ]
then
convert $tmpA0 -background "$bc" -rotate $rotation -density 300 $outfile
else
convert $tmpA0 -density 300 $outfile
fi

exit 0

Note -density has no bearing on the digital image. It only affects how the image is printed. So I don't understand your comment about distorting the image.
Post Reply