Re: What is the GraphicsMagick equivalent of ImageMagick's +opaque? (graphicsmagick: message 1 of 10)

[email protected] Sat, 19 Jan 2019 20:40:16 +0100 (CET)
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
Bob-

Thank you for the prompt response. :)

Sadly, as -channel, -operator and -recolor all work on channels, they did not work in my case.

I want only a specific colour preserved, the rest is deleted. Sortof like an image mask based on a selection by color. This is what +opaque does.

If that is not clear, I can attach the image and the transformed result. Does the list accept image attachments? The original is small (60KB) and has only 5 discrete colours.
 
I have thousands of images to process and switching to gm will make things faster and safer!

Thanks!


Jan 19, 2019, 7:21 PM by graphicsmagick.eggs.0b0a579db3.bfriesen#[email protected]:

> On Sat, 19 Jan 2019, > [email protected] <mailto:[email protected]>>  wrote:
>
>> Extracting a specific color (red) from an indexed BMP in ImageMagick goes like this:
>>
>> $ convert input.bmp +opaque "#FF0000" red.png
>>
>> Trying it with GraphicsMagick fails as it appears to not support +opaque, only -opaque.
>>
>
> Depending on if it meets your needs, you can use the -channel option:
>
>  gm convert input.bmp -channel Red red.png
>
> It is also possible to use the -operator and -recolor options to deal with image channels.
>
> This version assigns a zero value to the Green and Blue channels so you get a red channel which still looks red (rather than a grayscale image):
>
>  gm convert input.bmp -operator Green Assign 0 -operator Blue Assign 0 red.png
>
> Use of the -recolor command is left as an exercise but the documentation provides useful examples. :-)
>
>> How does one do the equivalent with GraphicsMagick? Perhaps there is a cheatsheet for migrating from ImageMagick to GraphicsMagick?
>>
>
> The GraphicsMagick options documentation (also the manual page) is useful since it is pretty accurate and well maintained.
>
> I am not sure of a cheat-sheet.
>
> Bob
> -- 
> Bob Friesenhahn
> [email protected] <mailto:[email protected]>> , > http://www.simplesystems.org/users/bfriesen <http://www.simplesystems.org/users/bfriesen/>
> GraphicsMagick Maintainer, > http://www.GraphicsMagick.org <http://www.GraphicsMagick.org/>
> Public Key, > http://www.simplesystems.org/users/bfriesen/public-key.txt <http://www.simplesystems.org/users/bfriesen/public-key.txt>
>
>
> _______________________________________________
> Graphicsmagick-help mailing list
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help <https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help>
>