Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-08-07T10:10:22-07:00
Your IM syntax is not correct for IM 6. try putting the image before the options.
convert "rgba.png" -alpha extract "alpha.png"
The quotes are not really needed unless you have a space in the file names, though it should not hurt to leave them.
see
http://www.imagemagick.org/Usage/basics/#why
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-08-07T12:39:19-07:00
The image you posted has no alpha channel. Perhaps it got removed when uploading or I am not downloading correctly.
Image: 693425zoom.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 854x650+0+0
Resolution: 72x72
Print size: 11.8611x9.02778
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 125.438 (0.491913)
standard deviation: 111.795 (0.438412)
kurtosis: -1.88083
skewness: 0.0740597
Green:
min: 0 (0)
max: 255 (1)
mean: 125.438 (0.491913)
standard deviation: 111.795 (0.438412)
kurtosis: -1.88083
skewness: 0.0740597
Blue:
min: 0 (0)
max: 255 (1)
mean: 129.79 (0.508981)
standard deviation: 112.132 (0.439732)
kurtosis: -1.86956
skewness: 0.0383976
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 126.889 (0.497603)
standard deviation: 111.907 (0.438852)
kurtosis: -1.87623
skewness: 0.0622613
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-08-07T16:17:33-07:00
You do not say what version of IM and platform you are using (or I missed it). But since IM 6.7.8.3 grayscale images have been linear rather than non-linear sRGB. So to get back what you expect you need to add -set colorspace RGB to your command as
convert 2101356optimized1.png -set colorspace RGB -alpha extract 2101356optimized1_alpha.png
This will get you back to what you want.
lilith
Posts: 8 Joined: 2010-10-06T23:37:50-07:00
Authentication code: 8675308
Post
by lilith » 2012-08-07T22:12:26-07:00
Hello,
I'm using 6.7.8.8.
And thanks, it works perfectly
Greetings.
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2012-08-07T22:43:12-07:00
Alpha channel is always linear, so I don't know why you need such a convoluted colorspace!
Oh, I get it copying linear alpha into non-linear color channels. Making image RGB first fixes that!