Nick Cummings on  wrote...
| I tried posting this on the ImageMagick Studio forum,
| but I didn't get any responses.  I'm hoping to have
| better luck here.  My apologies to those who are
| seeing this for the second time.
|
| I'm trying to make some images of equations I have
| written in LaTeX, using my Linux system.  I want the
| equations to be a with black text on a transparent
| background. I originally tried a program called eqe
| (that apparently uses ImageMagick internally), but I
| found that if I tried producing a PNG of black text on
| a transparent background, it appeared to have
| white-ish bits at the edges of the text if placed on a
| dark background.  I gather that this is due to
| anti-aliasing.
|
| What I'm currently trying to do is use the ImageMagick
| (6.0.6) command line tool "convert"  in Linux to take
| a PNG image of black text on a white background and
| produce a PNG of black text on a transparent
| background.  If I simply apply the command
|
| convert -transparent white image_in.png image_out.png
|
That only converts perfectly white text to transparency.

What you want to do is use the 'grey scale'  black text on white
background as a 'transparency mask' for some other color, such as
a transparent mask of a pure black image...

EG:

   cpnvert  image_in.png +matte \
           \( +clone -fill black -colorize 100% \) \
           +swap -compose CopyOpacity -composite \
           image_out.png

The first line ensures the initial image (mask) is read in and fully
opaque.

The second creates a pure black image the same size as the mask.

The third uses the first image as a transparency mask for the second
and finally we output the result.

See.. IM Examples..
  Using Masks with Images
    http://www.cit.gu.edu.au/~anthony/graphics/imagick6/channels/#masks
  Using Compose Mask to Limit the Composed Area
    http://www.cit.gu.edu.au/~anthony/graphics/imagick6/compose/#mask



  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
   ..., the kind of rain that is merely a upright sea with slots in it.
                                        -- Terry Pratchett - ``Truckers''
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to