Page 1 of 1
How to change logo color
Posted: 2017-12-14T02:15:58-07:00
by satimis
Hi all,
I have a logo .png file (only words) in red color with transparent background.
Is there a command line to change the color of the words from red to yellow? Please advise. Thanks
Regards
satimis
Re: How to change logo color
Posted: 2017-12-14T02:36:11-07:00
by satimis
Hi all,
Following command helps me out:
⟫ convert traces_of_life_10_en.png -fuzz 15% -fill yellow -opa
que "#c03030" traces_of_life_10_en_yellow.png
I found it on Internet
Could you please help me to understand;
-fuzz 15%
-opaque "#c03030"
?
Thanks
satimis
Re: How to change logo color
Posted: 2017-12-14T06:31:04-07:00
by snibgo
Documentation of the options is at
http://www.imagemagick.org/script/comma ... ptions.php
"-opaque {colour}" means "change pixels that are currently {colour} to the fill colour".
If fuzz was zero, only pixels that were
exactly {colour} would be changed. With a fuzz of 15%, all colours that were within 15% of {colour} are changed.
Re: How to change logo color
Posted: 2017-12-14T06:58:56-07:00
by GeeMack
satimis wrote: ↑2017-12-14T02:15:58-07:00I have a logo .png file (only words) in red color with transparent background.
Is there a command line to change the color of the words from red to yellow?
Depending on your version of IM one or both of these should do what you describe...
Code: Select all
convert logo.png -fill yellow -colorize 100 logo_out.png
Code: Select all
convert logo.png ( +clone -fill yellow -colorize 100 ) +swap -compose copyopacity -composite logo_out.png
If you're on a *nix platform you'll have to escape those parentheses with backslashes like "\( ... \)".
It's always best if you provide your version of IM and what platform you're working on.
Re: How to change logo color
Posted: 2017-12-14T20:56:25-07:00
by satimis
GeeMack wrote: ↑2017-12-14T06:58:56-07:00
satimis wrote: ↑2017-12-14T02:15:58-07:00I have a logo .png file (only words) in red color with transparent background.
Is there a command line to change the color of the words from red to yellow?
Depending on your version of IM one or both of these should do what you describe...
Code: Select all
convert logo.png -fill yellow -colorize 100 logo_out.png
Code: Select all
convert logo.png ( +clone -fill yellow -colorize 100 ) +swap -compose copyopacity -composite logo_out.png
If you're on a *nix platform you'll have to escape those parentheses with backslashes like "\( ... \)".
It's always best if you provide your version of IM and what platform you're working on.
Hi,
Thanks for your advice.
I found following command on Internet;
Code: Select all
$ convert input_file.png -fuzz 15% -fill '#xxxx' -opaque "#c03030" output_file.png
I only substituted '#xxxx' with yellow, then it worked for me without problem.
I have another logo same as the first one with only words in green color and transparent background but;
Code: Select all
$ convert input_file.png -fuzz 15% -fill red -opaque "#c03030" output_file.png
couldn't work and the green color remained unchanged.
Then I increased 15% to 80%. It worked changing the logo color to red.
I can't understand why I need to increase -fuzz?
Your recommended 2 command lines work for me but I prefer the first one. It is easy to remember.
$ convert --version
Code: Select all
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
Thanks
Regards
satimis
Re: How to change logo color
Posted: 2017-12-14T21:12:30-07:00
by satimis
snibgo wrote: ↑2017-12-14T06:31:04-07:00
Documentation of the options is at
http://www.imagemagick.org/script/comma ... ptions.php
"-opaque {colour}" means "change pixels that are currently {colour} to the fill colour".
If fuzz was zero, only pixels that were
exactly {colour} would be changed. With a fuzz of 15%, all colours that were within 15% of {colour} are changed.
Hi,
Thanks for your advice and link.
"-opaque {colour}" means "change pixels that are currently {colour} to the fill colour".
"#c03030" is not the color of my logo. It was in the command line which I found on Internet. But without changing it the command line still worked? Why?
Regards
satimis
Re: How to change logo color
Posted: 2017-12-15T05:08:48-07:00
by snibgo
I guess, because your logo colour is within 15% of #c03030.
Re: How to change logo color
Posted: 2017-12-15T05:56:04-07:00
by satimis
snibgo wrote: ↑2017-12-15T05:08:48-07:00
I guess, because your logo colour is within 15% of #c03030.
Noted and thanks
satimis