Page 1 of 2

Rasterized Text

Posted: 2010-10-01T07:36:50-07:00
by immortal26
Get right into it:

I have a background image at 150 dpi and high resolution 2100x1700.

I am trying to right text with something simple such as.

convert bg.jpg -pointsize 20 -density 150 -font myfont.ttf -background none -fill black label:'hello world' -composite final.pdf

This is being printed on a kodak nexpress. The text even on my screen is so low res that it comes out completely out of register.

If I zoom in on the pdf it's so blurry around the edges which is making out of register when it prints.

I have tried almost everything I can think of, but nothing seems to be working. (which is where i wish vector text can be used)

Is there anything I'm missing or maybe someone else has run into to solve this?

Thanks,
Immortal

Re: Rasterized Text

Posted: 2010-10-01T09:54:14-07:00
by Drarakel
There are probably several ways to add text (you could also use e.g. "-annotate"). But if you want the text on the background just to be bigger, then you probably should increase the pointsize.
Or do you want to achieve something different?

Re: Rasterized Text

Posted: 2010-10-01T11:56:22-07:00
by immortal26
Nah, has nothing to do with which method I use to write the text. They all come up blurry, even with default IM font.
It has to be something to the point of when I'm writing to the pdf.
The text should be grayscale, but after looking at the print the text is cmyk. Which is making it look blurry.

Re: Rasterized Text

Posted: 2010-10-01T14:05:48-07:00
by fmw42
is your original jpg CMYK? note I don't know about other text functions but think -draw does not work in CMYK. So perhaps you should check your jpg and see and if CMYK, then use profiles to convert to rgb before writing text.

Re: Rasterized Text

Posted: 2010-10-01T23:20:43-07:00
by Drarakel
I would first write it as normal image - JPG or TIFF (not PDF). If the size of the text is ok and you are still getting "blurry" text, then perhaps you should specify the output options (compression and quality). IM takes these things from the input file if nothing else is specified, so you end up with JPG compression and perhaps bad settings for quality and sampling-factor. But first you should check the CMYK issue, yes.

Re: Rasterized Text

Posted: 2010-10-04T09:13:34-07:00
by immortal26
Okay, I just tried converting the original background image to RGB and to a tif with no compression (not worried about size right now)

Using the command to write text on that tif:
convert final.tif -pointsize 45 -font myfont.ttf -background transparent -fill black -gravity south label:'Hello World' -geometry +0+25 -composite final.tif

Text still is blurry and out of register when I print it out.
Using latest version of ImageMagick as well.

Re: Rasterized Text

Posted: 2010-10-05T20:23:36-07:00
by immortal26
So I'm assuming there is really no way to get at least close to vector text (even though I know it's rasterized)?
I'm going to have to scrap my whole project.

For example, Photoshop rasterizes text/images etc... but when using same font, size etc... and print it out with no compression etc.. It looks fine.
With IM the edges are so blurry the printed text is so jagged and blurry it's useless.

Magick can you shed some light on this at all?

Re: Rasterized Text

Posted: 2010-10-05T21:34:02-07:00
by fmw42
immortal26 wrote:Okay, I just tried converting the original background image to RGB and to a tif with no compression (not worried about size right now)

Using the command to write text on that tif:
convert final.tif -pointsize 45 -font myfont.ttf -background transparent -fill black -gravity south label:'Hello World' -geometry +0+25 -composite final.tif

Text still is blurry and out of register when I print it out.
Using latest version of ImageMagick as well.

What happens if your input image is a constant color background image created from -size WidthxHeight xc:somecolor and you also put -geometry before Label: (after -gravity). Then set the density in your command as well. You may be getting a 72 dpi density from your input tif file and need a higher density for printing.

Re: Rasterized Text

Posted: 2010-10-06T12:43:49-07:00
by immortal26
So instead of

Code: Select all

convert final.tif -pointsize 45 -font myfont.ttf -background transparent -fill black -gravity south label:'Hello World' -geometry +0+25 -composite final.tif
try this?

Code: Select all

convert final.tif -pointsize 45 -font myfont.ttf -background transparent -fill black -gravity south -geometry +0+25 -density 150 label:'Hello World'  -composite final.tif
I believe that is what your saying to try.

Re: Rasterized Text

Posted: 2010-10-06T13:58:12-07:00
by fmw42
immortal26 wrote:So instead of

Code: Select all

convert final.tif -pointsize 45 -font myfont.ttf -background transparent -fill black -gravity south label:'Hello World' -geometry +0+25 -composite final.tif
try this?

Code: Select all

convert final.tif -pointsize 45 -font myfont.ttf -background transparent -fill black -gravity south -geometry +0+25 -density 150 label:'Hello World'  -composite final.tif
I believe that is what your saying to try.
Yes but also replacing your input image with a constant color image

convert -size 500x500 xc:white ...

or

convert -size 500x500 -background white ...

I don't see why you include -background transparent if you are writing text over an image. All you need is to specify the -fill color for the text.

Re: Rasterized Text

Posted: 2010-10-07T06:18:42-07:00
by immortal26
Yes the final.tif is a constant color image, but I need to write the text on that image and composite it out into a final image (just using final.tif again for final image).

So I'm assuming it's best practice to write text onto a pure white background per say:

Code: Select all

convert -size 500x500 -background white -pointsize 45 -font myfont.ttf -fill black -gravity center -density 150 label:'Hello World' caption.tif
And then... put that caption.tif on the final.tif with the gravity/geometry settings:

Code: Select all

convert final.tif caption.tif -gravity south -geometry +0+25 -composite final.tif
Would that be a better way to go?

Re: Rasterized Text

Posted: 2010-10-07T08:50:04-07:00
by immortal26
Still blurry. I think this is a lost cause.

Example of what I'm talking about using the command below:

Code: Select all

convert -size 500x500 -background white -pointsize 45 -font myfont.ttf -fill black -gravity center -density 150 label:'Hello World' caption.jpg
http://core.kpcdigital.com/mvp/stadium/ ... aption.jpg

As you can see, the edges are so blurry and has the step ladder effect going on..(jagged) when printed on a nexpress it takes the blurry spots and jaggedness and tries it's best to interperet as best it can... which looks like it's out of register, alot of the blurriness and jaggedness get's ignored leaving whitespace.

In photoshop using the same font, dpi, fontsize etc... gives me a great print, even though it's still rasterized... but IM seems to try to hard to smooth edges etc...

Is there another program that I can use along with Imagemagick to get a more vector looking text.

Re: Rasterized Text

Posted: 2010-10-07T08:52:58-07:00
by el_supremo
Does turning off antialiasing help?

Code: Select all

convert -size 500x500 -background white -pointsize 45 -font myfont.ttf -fill black -gravity center -density 150 +antialias label:'Hello World' caption.jpg
Pete

Re: Rasterized Text

Posted: 2010-10-07T08:59:20-07:00
by immortal26
I have tried that, and as you can see:
http://core.kpcdigital.com/mvp/stadium/ ... ption2.jpg

Lol, nope that's not going to work.
Thanks though

Re: Rasterized Text

Posted: 2010-10-07T09:28:20-07:00
by magick
Post an image composited with Photoshop and hopefully an image with just the text. Can you post a URL to your font? We have a few ideas on how to render improved text but we need something to compare it too to ensure we're on the right track.