I would like to make simple text label in RGB (or RGBA) .png file.
What I did is:
convert -font Tahoma -pointsize 240 -undercolor black -fill whilte \
label:ABC -colorspace RGB -depth 8 out.png
It works just fine, but got the result in grayscale format.
I tried moving '-colorspace' position before '-font' command or other places, but always getting only grayscale result.
How can I get RGB (or RGBA) result?
I'm using ImageMagick-6.9.2-Q16.
TIA
How to make 'label:' in RGB .png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to make 'label:' in RGB .png
You misspelled white. Also you should use -background black rather than -undercolor. You do not need -colorspace, but whenever you do, you should use -colorspace sRGB not -colorspace RGB. The latter is linear and thus will be darker. Try
If transparency, use PNG32: rather than PNG24:
See
http://www.imagemagick.org/Usage/text/#label
http://www.imagemagick.org/Usage/formats/#png_formats
Also in the future, please always specify your platform, since there can be syntax differences on Windows and Unix systems. Also best to specify the full IM version via
Code: Select all
convert -font Tahoma -pointsize 240 -background black -fill white label:"ABC" -depth 8 PNG24:result.png
See
http://www.imagemagick.org/Usage/text/#label
http://www.imagemagick.org/Usage/formats/#png_formats
Also in the future, please always specify your platform, since there can be syntax differences on Windows and Unix systems. Also best to specify the full IM version via
Code: Select all
convert -version
Re: How to make 'label:' in RGB .png
Thanks for your very fast reply, fmw42.
I got exactly what I need following your direction.
Still I'm not sure what I was wrong, but anyway I gonna read more docs as you indicated.
Thank you.
BTW, my platform is WindowsXp/8.1, and the IM '-version' says:
Version: ImageMagick 6.9.2-4 Q16 x86 2015-10-10 ...
Visual C++: 180031101 ...
I got exactly what I need following your direction.
Still I'm not sure what I was wrong, but anyway I gonna read more docs as you indicated.
Thank you.
BTW, my platform is WindowsXp/8.1, and the IM '-version' says:
Version: ImageMagick 6.9.2-4 Q16 x86 2015-10-10 ...
Visual C++: 180031101 ...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to make 'label:' in RGB .png
Generally, IM will force a grayscale format if the data is grayscale and if the image type supports that. To overcome grayscale in order to output an (s)RGB format, some image types such as TIF will respect -type truecolor or truecoloralpha. PNG requires the use of PNG24: or PNG32:. JPG needs a special define to overcome that issue. See http://www.imagemagick.org/script/formats.php
Re: How to make 'label:' in RGB .png
fmw42,
> Generally, IM will force a grayscale format if the data is grayscale and if the image type supports that.
Oh, I understood. It's a very important point that I miffed.
Thanks again.
> Generally, IM will force a grayscale format if the data is grayscale and if the image type supports that.
Oh, I understood. It's a very important point that I miffed.
Thanks again.