Hello,
I'd like to reduce red tint in areas where red color isn't visually dominant. I've got and idea to play with something like:
abs(b-g) > 0.1 && r-max(b,g) < 0.1 ? r*0.9
Two questions:
- how to implement it with -fx ; for now it responds
convert.exe: unable to parse expression `r' @ error/fx.c/FxEvaluateSubexpression/2307.
- any other idea how to solve that problem?
$ convert -version
Version: ImageMagick 6.9.3-5 Q8 x64 2016-02-20 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
don't grok -fx
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: don't grok -fx
The "?" operator is ternary: it needs three expressions. You are missing a colon and the third expression, eg:
When the first expression is true, the result is r*0.9. When it is false, the result is r. (Of course, put whatever you need for the third expression.)
Code: Select all
abs(b-g) > 0.1 && r-max(b,g) < 0.1 ? r*0.9 : r
snibgo's IM pages: im.snibgo.com
Re: [SOLVED] don't grok -fx + reduce red tint in non red areas
Thank you very much. I've improved my command. Pure RGB path was nonsense, solution which works perfectly for me:
Code: Select all
convert file.tif -channel H -fx "hue < 0.93 && hue > 0.07 && saturation > 0.15 ? r * 0.98 : r" +channel file-fx.tif