Re: How to have monocrome "Dark Blue" rather than "Black" for the following operation?
Bob Friesenhahn <[email protected]> Tue, 4 Jul 2023 08:33:19 -0500 (CDT)
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 3 Jul 2023, Susmita/Rajib wrote:
> [ ... ]
> Your first challenge would be that the JPEG format does not support
> transparency. GIF and PNG formats do.
Perhaps something like this will work well for you:
gm convert -density 100 name.pdf -colorspace Gray -colorspace rgb \
-fill blue -colorize 0/0/100 -transparent white +adjoin name-%03d.gif
or perhaps:
gm convert -density 100 name.pdf -colorspace Gray -colorspace rgb \
-fill blue -colorize 0/0/100 -fuzz 1% -transparent white +adjoin \
name-%03d.gif
If you are looking for arithmetic perfection, then it could be useful
to know that relative intensities of the red, green, and blue, which
make up grey (luma) are not uniformly proportional at all. This is
the equation for Rec.709 RGB
Luma = 0.2126*red + 0.7152*green + 0.0722*blue
This suggests that perhaps the optimum colorize proportion for blue is
something other than 100% if you are intending that the relative
intensity of the result in blue is the same as the original gray
image.
Bob
--
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt