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?".
aytac0x
Posts: 2 Joined: 2015-06-09T06:55:24-07:00
Authentication code: 6789
Contact:
Post
by aytac0x » 2015-06-09T07:28:13-07:00
I am getting different result when I apply -contrast-strect 0 on a single channel by using -channel operator and when I use -contrast-strecth after I separate the channels. Any hints why this is the case?
I tried this with LAB LCHab and HSL using latest imagemagick on arch linux.
original image:
https://dl.dropboxusercontent.com/u/22023572/a3.png
Using -channel
Code: Select all
convert img.png -colorspace LAB -channel L -contrast-stretch 0 -colorspace sRGB img_lab_only_L_auto.png
result:
https://dl.dropboxusercontent.com/u/220 ... uto_a3.png
Doing it "by hand"
Code: Select all
convert img.png -colorspace LAB -separate img_lab_channel_%d.png
convert img_lab_channel_0.png -contrast-stretch 0 img_lab_channel_0_stretched.png
convert img_lab_channel_0_stretched.png img_lab_channel_1.png img_lab_channel_2.png -set colorspace LAB -combine -colorspace sRGB img_lab_only_L.png
result:
https://dl.dropboxusercontent.com/u/220 ... y_L_a3.png
Any ideas?
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
Post
by snibgo » 2015-06-09T07:58:58-07:00
Annoyingly, "-channel L" is a synonym for "-channel B", ie the third channel, not the first channel. Use "-channel R" instead.
EDIT: I said "-channel G" but meant "-channel B".
aytac0x
Posts: 2 Joined: 2015-06-09T06:55:24-07:00
Authentication code: 6789
Contact:
Post
by aytac0x » 2015-06-10T02:48:59-07:00
Hmm so L is the L in HSL. At first I thought the problem was about the Sync flag for -channel.
When I looked at the output of
i can see A and B as well. That was misleading, So A is for Alpha and B is for Black?
edit: B must be for Blue, I am overthinking...
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
Post
by snibgo » 2015-06-10T03:17:24-07:00
A is for Alpha
B is for Blue (the third channel, whatever colour model)
I only ever use R, G, B and A. If I did CMYK work, I would also use those.
Users browsing this forum: Amazon [Bot] , Bing [Bot] , Google [Bot] , Semrush [Bot] and 79 guests