Trying to generate crisp text (se examples)
Trying to generate crisp text (se examples)
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?
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Trying to generate crisp text (se examples)
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/
see http://www.imagemagick.org/Usage/text/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Trying to generate crisp text (se examples)
-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.
stroke values below 1 do not seem to work very well, but may work in this case.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Trying to generate crisp text (se examples)
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.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/
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?
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Trying to generate crisp text (se examples)
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):
[EDIT] ERK - no it doesn't. There's a few bits missing. I'll play with it some more.[/EDIT]
Pete
Code: Select all
convert +antialias -background transparent -fill '#000000' -font Arial -pointsize 12 -strokewidth 1 label:'name@domain.com' label.png
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Trying to generate crisp text (se examples)
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.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Trying to generate crisp text (se examples)
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'.
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'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Trying to generate crisp text (se examples)
Oh ok, so photoshop uses a different font than i use on my imagemagick server?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'.
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)
Thank you, let me know if you do any successel_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):[EDIT] ERK - no it doesn't. There's a few bits missing. I'll play with it some more.[/EDIT]Code: Select all
convert +antialias -background transparent -fill '#000000' -font Arial -pointsize 12 -strokewidth 1 label:'name@domain.com' label.png
Pete
Re: Trying to generate crisp text (se examples)
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.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.
Thank you for your suggestion.
Re: Trying to generate crisp text (se examples)
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.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.
Any other ideas?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Trying to generate crisp text (se examples)
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/