Page 1 of 1

Trying to colorize png

Posted: 2015-03-19T14:49:26-07:00
by jujube
Hi everyone,

I'm looking for a way to colorize PNG image, regardless the PNG's content.
For example, if I take these two differents PNG:

Image Image

and I want to give them a green tint, the output should be:

Image Image

(photoshop approximation)

Any help would be appreciated. :)

IM version 6.7.7-10 2014-03-08 Q16

Re: Trying to colorize png

Posted: 2015-03-19T16:43:57-07:00
by snibgo
This isn't exactly the same as your desired output (Windows BAT syntax):

Code: Select all

convert sr3BsQF.png -modulate 100,0,100 +level-colors rgb(0,50%%,0),lime a.png

convert R8Y94q4.png -modulate 100,0,100 +level-colors rgb(0,50%%,0),lime b.png

Re: Trying to colorize png

Posted: 2015-03-20T11:53:23-07:00
by jujube
Thank you snibgo !

It does almost what I need :)
It works perfectly well for markers like the first one, but the second marker's colors are flatten..

Image

This one was converted with a simple hex color

convert marker2.png -modulate 100,0,100 +level-colors '#ff8400' result.png

Re: Trying to colorize png

Posted: 2015-03-21T11:05:03-07:00
by PandoraBox
From the section : http://www.imagemagick.org/Usage/color_ ... dulate_hue

I edited the lines to fit your image that was uploaded.

convert YPuLOBp.png -modulate 100,100,0 YPuLOBp_mod_hue_0.png
convert YPuLOBp.png -modulate 100,100,33.3 YPuLOBp_mod_hue_33.png
convert YPuLOBp.png -modulate 100,100,66.6 YPuLOBp_mod_hue_66.png
convert YPuLOBp.png -modulate 100,100,100 YPuLOBp_mod_hue_100.png
convert YPuLOBp.png -modulate 100,100,133.3 YPuLOBp_mod_hue_133.png
convert YPuLOBp.png -modulate 100,100,166.6 YPuLOBp_mod_hue_166.png
convert YPuLOBp.png -modulate 100,100,200 YPuLOBp_mod_hue_200.png

I'm new to some of the tricks but this one I noticed it when I was making a trip out background for a chroma screen, chances are your looking more for applying a color filter to have them all in the same range.

Only other goodies I found we're at Freds page

http://www.fmwconcepts.com/imagemagick/ ... /index.php Convert your image to grey scale then back to 3 color tints
or http://www.fmwconcepts.com/imagemagick/ ... /index.php which gives you a hue wheel to work with.

Hope this helps or gives ideas to others to point you in the right direction