Fonts, Aliasing, Transparency 6.2.5 vs 6.2.6

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?".
Locked
dognose
Posts: 268
Joined: 2005-03-08T22:16:37-07:00

Fonts, Aliasing, Transparency 6.2.5 vs 6.2.6

Post by dognose »

I updated IM to 6.2.6 and noticed a weird problem when drawing text on a transparent background.

Example in 6.2.5:
Image

Example in 6.2.6:
Image

On both of these, I start with a transparent gif, then draw the font on it w/ black as the fill color. These images need to be transparent, as they will be placed on an image in a web browser.

Now, I realize that neither is prefect, but to me, the first is a bit more readable.

Is there a way I can get the same effect as I did in 6.2.5? Or, is there a way I can get even better results?
Last edited by dognose on 2006-03-16T23:29:35-07:00, edited 1 time in total.

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Now try saving to PNG instead. The problem with GIF is there is only one level of transparency and no one algorithm can produce "good" results for all images. You may get improved results by adding -fuzz 50% to your command line. Change the 50 up and down until you get reasonable results.

dognose
Posts: 268
Joined: 2005-03-08T22:16:37-07:00

Post by dognose »

Well, I'd love use PNG, but IE doesn't seem to support transparency in PNG files, so, I have to use GIF.

in 6.2.5, the -fuzz 50% works great, and it looks much better!

however, in 6.2.6, the fuzz option does nothing.. am I stuck having to use 6.2.5?

here's an update with fuzz in 6.2.5:

Image

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

IE 7.0 Beta 2 supports PNG transparency.

Do help further we need to reproduce the problem. Post a command line or script we can use to produce the results you get and we will try to come up with a reasonable solution.

dognose
Posts: 268
Joined: 2005-03-08T22:16:37-07:00

Post by dognose »

Code: Select all

convert -fuzz 50% -size 150x60 xc:transparent -font "fonts/AirConditioner.ttf" -pointsize 48 -draw "text 0,50 'Test'" test.gif
Image

Convert was installed from ImageMagick-6.2.6-3.x86_64.rpm

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

We'll need a URL to the Airconditioner.ttf font.

dognose
Posts: 268
Joined: 2005-03-08T22:16:37-07:00

Post by dognose »

Sorry, this was causing me a problem for all the fonts (some looked much worse than others) I don't have standard fonts installed to test with.

http://www.1001freefonts.com/winfonts/a ... tioner.zip

This one also looked real bad:
http://www.1001freefonts.com/winfonts/ayummyapology.zip

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Saving images with transparency (fonts or otherwise) is dealt with in the IM examples at
http://www.cit.gu.edu.au/~anthony/graph ... ats/#trans
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

dognose
Posts: 268
Joined: 2005-03-08T22:16:37-07:00

Post by dognose »

ok, thanks, I was able to get similar results now using: -channel A -threshold 50%

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

The point is you can now adjust how the semi-transparent pixels convert to full transparency, or opacity.

The use of -fuzz in this regard I never accepted as a practical way as fuzz has always been more to do with color comparisions rather than transpaency thresholding. I like to keep them separate.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Locked