text is cut off after upgrade

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: text is cut off after upgrade

Post by snibgo »

If removing the height eliminates pixellation, you should be able to see that.

Can you provide the input and output files, and values used for width and height?
snibgo's IM pages: im.snibgo.com
danieldan
Posts: 11
Joined: 2013-07-06T08:53:11-07:00
Authentication code: 6789

Re: text is cut off after upgrade

Post by danieldan »

Removing the height didn't help.

As for input file and output file, the input is initially just fonts. In the end, it's outputting a pdf. Let me go through the code to manually create the input image file. I'll be back with updates. Maybe in the process of manually going through it, I'll find exactly where the pixelization is occuring.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: text is cut off after upgrade

Post by fmw42 »

I don't have your font, so I just used arial

This works just fine for me on IM 6.8.6.7 Q16


convert -size 255x299 -background transparent -font arial -fill "#000000" label:"Text Here" -trim +repage 00text.png
Image

convert 00text.png -resize 155x199 -depth 8 0text.png
Image

Which you can write in one command as:
convert -size 255x299 -background transparent -font arial -fill "#000000" label:"Text Here" -trim +repage \
-resize 155x199 -depth 8 1text.png


Doing a resize to 400% is not to badly aliased:

convert -size 255x299 -background transparent -font arial -fill "#000000" label:"Text Here" -trim +repage \
-resize 400% -depth 8 2text.png

Image

But you would be better just creating the text size you want rather than resizing it.

convert -size 1020x1196 -background transparent -font arial -fill "#000000" label:"Text Here" -trim +repage -depth 8 3text.png

Image


If you try to save to PDF and then make it larger either by using -resize or just using -density, it will stairstep, because the PDF is just an image in a PDF wrapper and not truly scalable any longer.

You can gain a bit by saving to svg and then using -density to make it larger.

However to do either PDF or SVG, you would really need to vectorize the text before saving to either. see
http://www.imagemagick.org/Usage/draw/#svg_output
http://www.imagemagick.org/Usage/draw/#other

But the best pixel way is just to create the text to the size you need.

If you are trying to do something else, please clarify and provide the exact command with arguments provided.

Please note that -quality 100 is not what you think for PNG. It is appropriate for JPG. But PNG quality/compression is specified differently. See http://www.imagemagick.org/script/comma ... hp#quality for PNG quality. Nominal is 75 and the numbers mean something different than a range of 0 to 100. Each digit means something different.

Note that I removed the -quality and reordered your command lines to more proper IM 6 syntax.
danieldan
Posts: 11
Joined: 2013-07-06T08:53:11-07:00
Authentication code: 6789

Re: text is cut off after upgrade

Post by danieldan »

Thank you Fred! It works now. :D It was generating text at 500 pixels wide when it should have been 4500 pixels wide. Let me know if you have any trouble ordering your free shirt.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: text is cut off after upgrade

Post by fmw42 »

danieldan wrote:Let me know if you have any trouble ordering your free shirt.
Thanks for the offer, but it is really not necessary.
Post Reply