I have a dark image which histogram lies in a tight group.
In image editor I can convert image int HSL colorspace, separate L channels and make histogram adjustment.
Is this the right way? Which next steps are necessary to do?
Is there a universal solution how to work with such histogram and improve image brightness/contrast?
How can I do the same thing with ImageMagick?
One simple method in Imagemagick is simply -auto-level.
Input:
convert img.png -auto-level result.png
If you want to replicate what you did, then in Unix syntax, convert your level parameters to percents: low=100*87/255=34.1% and high=100*141/255=55.3% and gamma=1.83
convert img.png -colorspace LAB -separate -write mpr:LAB \
\( mpr:LAB[0] -level 34.1%,55.3%,1.83 \) \
-swap 0,3 +delete \
-set colorspace LAB -combine -colorspace sRGB \
result.png
For Windows, remove the \ from the parentheses and change the end of line \ to ^. Double the % if in .bat file.