Reputation: 18278
With ImageMagick shell command (convert
?)...
Given a colorful input.png
image.
How to us input.png
to produce a white output.jpg
version with similar dimensions an opacity of 100% ?
I will later on use this layer in my workflow.
Upvotes: 0
Views: 63
Reputation: 208052
You could use fill
, like this:
convert input.png -fill "#ffffff" output.jpg
or
convert input.png -fill white output.jpg
Or you can convert all three channels (red, green and blue) to "1" which is full intensity, like this:
convert input.png -channel red -fx "1" -channel green -fx "1" -channel blue -fx "1" output.jpg
Upvotes: 1
Reputation: 12465
This should work:
convert input.png -threshold -1 output.jpg
This transforms any pixel with an intensity greater than (-1), i.e., all of them, to white. It does not work with GraphicsMagick, though, because in GM the threshold value is unsigned (in ImageMagick it's a signed "double"). Neither of the applications documents exactly what is supposed to happen when the threshold is negative.
Here's a command that works on both ImageMagick and GraphicsMagick, and is documented:
[gm] convert input.png -fuzz 100% -fill white -opaque gray output.jpg
Upvotes: 2