skip to Main Content

So I have this base image:

enter image description here

And in photoshop I do a basic layer color overlay, with the rgb colors:

r: 244, g: 93, b: 0

This gives me the amazingly vibrant:

enter image description here

What I’m trying to do is colorize the same image in rmagick, so if I do the following colorize:

  img ='brush.png').first
  img = img.colorize(100, 100, 100,, 93, 0, 1))
  img.format = 'png'

It gives me this really washed out orange image:

enter image description here

My questions is, how do I colorize this image with those rgb params in imagemagick / rmagick, to get the same vibrant color that I got in photoshop.




  1. At the commandline, I think you want something like this:

    convert brush.png ( +clone -fill "rgb(244,93,0)" -colorize 100% ) -compose colorize  -composite out.png

    enter image description here

    So, with the +clone I am creating another layer the same size as your image and entirely filling it 100% with your orange colour and then composing it over your image with the -composite to blend the opacity and colour.

    I really don’t speak Ruby, but I think it will be along these lines:

    require 'RMagick'
    include Magick
    Login or Signup to reply.
  2. Mark Setchell’s command line works for me (Windows), with slight modifications…

    convert greyscale.png +clone -fill "rgb(244,93,0)" -colorize 100% -compose colorize -composite colour.png

    Found this link on recolouring with rmagick…

    Based on the code in the above link, with the greyscale conversion removed, does the example below work (I don’t have ruby)?

    # load the greyscale image
    img ='greyscale.png').first
    # Colorize with a 100% blend of the orange color
    colorized = img.colorize(1, 1, 1, '#A50026')
    # save the colour image

    Used a colour picker to get the hex of your orange colour – rgb(244,93,0) = #A50026

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top