Getting different results when using -channel to contrast-stretch
Posted: 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
result: https://dl.dropboxusercontent.com/u/220 ... uto_a3.png
Doing it "by hand"
result: https://dl.dropboxusercontent.com/u/220 ... y_L_a3.png
Any ideas?
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
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
Any ideas?