Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm coming up empty handed while trying to find out how to modify the opacity of an image using the GraphicsMagick CLI. I'm simply trying to input a standard image and convert it to the corresponding image with a reduced opacity. I'm running GraphicsMagick 1.3.14. Using ImageMagick, I can issue the command:

convert input.png -alpha set -channel a -evaluate set 50% +channel output.png

However, the -alpha option (among others) is unrecognized as a valid GM convert option (convert option reference here). Any help would be greatly appreciated.

Note: This question is a cross post of a question on StackOverflow. After posting on SO, I thought SuperUser might be a little more appropriate.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The equivalent in GraphicsMagick is

gm convert input.png -operator Opacity Multiply 0.5 output.png

or

gm convert input.png -operator Opacity Assign 50% output.png

depending on what you really want to do (modulate or assign).

You should add -matte prior to -operator if you don't know if the image already has an active opacity channel.

Bob

share|improve this answer
    
Thank you Bob; the addition of the -matte operation got me what I wanted. Appreciate the help. –  naivedeveloper Jul 6 '12 at 2:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.