Page 1 of 1
Trying to generate crisp text (se examples)
Posted: 2010-12-16T05:01:43-07:00
by zlitrox
Hello,
I'm using ImageMagick (ImageMagick 6.6.2-5) and trying to generate sort of crisp text. Se below for example images.
My goal is to have the text look like this (created with Photoshop):
(
http://d0h.us/example_photoshop.png)
And having the result (created with ImageMagick):
(
http://d0h.us/example_imagemagick.png)
convert -antialias -background transparent -fill '#000000' -font Arial -pointsize 12 label:'
name@domain.com'
If i try without antialias it seems to miss some pixels:
(
http://d0h.us/example_imagemagick_noaa.png)
convert +antialias -background transparent -fill '#000000' -font Arial -pointsize 12 label:'
name@domain.com'
So what i want is the text to look like the one that were created in Photoshop. Can someone please help me?
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-16T10:51:27-07:00
by fmw42
try adding -strokewidth 0 and see if that helps (not sure if that works with label:), but you could try using either -annotate or -draw and see if they do what you want.
see
http://www.imagemagick.org/Usage/text/
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-16T17:39:51-07:00
by anthony
-strokewidth will not do anything (except posible minor size effect) without -stroke {color} also being set.
stroke values below 1 do not seem to work very well, but may work in this case.
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-17T02:27:48-07:00
by zlitrox
fmw42 wrote:try adding -strokewidth 0 and see if that helps (not sure if that works with label:), but you could try using either -annotate or -draw and see if they do what you want.
see
http://www.imagemagick.org/Usage/text/
Thanks for the tip, but unfortunately "-strokewidth 0" didnt do any change to the text even with or without "-stroke #000000". Also i've tried -draw but didnt work with that.
I thought that maybe it could be "-style", "-weight" or "-stretch" but when i looked fast at them it didnt do any change. Maybe i'm doing something wrong...
Do you guys have any other tip?
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-17T09:26:53-07:00
by el_supremo
This produces an image that looks identical to the photoshop version (using IM 6.6.5-8 2010-11-10 Q16 on Win 7 Pro x64):
Code: Select all
convert +antialias -background transparent -fill '#000000' -font Arial -pointsize 12 -strokewidth 1 label:'name@domain.com' label.png
[EDIT] ERK - no it doesn't. There's a few bits missing. I'll play with it some more.[/EDIT]
Pete
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-17T10:46:13-07:00
by fmw42
Is it possible that PS and IM are using two different fonts, even if named the same? Perhaps PS has its own imbedded fonts? Or they are the same named fonts but slightly different versions and are in different directories.
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-17T16:05:11-07:00
by anthony
I think the real difference is in the selection of the font.
You can get fonts that are designed to be a 'bitmap' when drawn. That is no anti-aliasing pixels included.
It really depends on what you mean by 'crisp'.
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-18T03:56:22-07:00
by zlitrox
anthony wrote:I think the real difference is in the selection of the font.
You can get fonts that are designed to be a 'bitmap' when drawn. That is no anti-aliasing pixels included.
It really depends on what you mean by 'crisp'.
Oh ok, so photoshop uses a different font than i use on my imagemagick server?
What i tried to show with crisp is that a generated image should look more like html-text if you know what i mean. The text in html are not like smooth as sIFR text or any text created with antialias. Maybe its just the thickness of the generated text that makes my images look different...
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-18T03:57:35-07:00
by zlitrox
el_supremo wrote:This produces an image that looks identical to the photoshop version (using IM 6.6.5-8 2010-11-10 Q16 on Win 7 Pro x64):
Code: Select all
convert +antialias -background transparent -fill '#000000' -font Arial -pointsize 12 -strokewidth 1 label:'name@domain.com' label.png
[EDIT] ERK - no it doesn't. There's a few bits missing. I'll play with it some more.[/EDIT]
Pete
Thank you, let me know if you do any success
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-18T04:00:00-07:00
by zlitrox
fmw42 wrote:Is it possible that PS and IM are using two different fonts, even if named the same? Perhaps PS has its own imbedded fonts? Or they are the same named fonts but slightly different versions and are in different directories.
I'm using TrueType-font with full specified path then generating ImageMagick image. But that could be a possible problem, i'll try to copy the font that PS is using to my server that generates ImageMagick image and see if it works.
Thank you for your suggestion.
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-20T06:49:55-07:00
by zlitrox
fmw42 wrote:Is it possible that PS and IM are using two different fonts, even if named the same? Perhaps PS has its own imbedded fonts? Or they are the same named fonts but slightly different versions and are in different directories.
I copied the font that Photoshop uses to the server that generates ImageMagick images but the same thing. Looks like the examples i included in my first post.
Any other ideas?
Re: Trying to generate crisp text (se examples)
Posted: 2010-12-20T18:47:11-07:00
by anthony
As the TTF font file is the same, the difference will be down to the way the font is 'rendered' or drawn onto a raster image.
ImageMagick calls on a separate library, freetype, to do this. It basically passes the text and the parameters to this library and gets back a raster image, and actually does not have control of how the font is rendered.
Different versions of that library have resulted in different results. Maybe you can upgrade that library.