Actually, you don’t have to escape your backslash, it’s just echo
that needs an escaped backslash if you want to print the value of the variable.
I should have written e '{/${GMIC_CACHE_PATH}}'
Inside the math parser, I wonder if there could be a fast warp()
command? This is only a rough idea - not sure how it would work in practice. Perhaps taking a vector parameter treated as MxN matrix and returning another? I’ll probably do some tests by defining one myself, maybe it’s already fast enough…
Edit: appears to be reasonably fast with a static warp field:
gcd_kernel_warp : skip ${1=3}
{$1*$1},2,1,1,u(-200,200) # warp field image
f.. "begin(const boundary=1; const S = w#-1; W = vectorS());
for(k=0,k<S,k++,W[k]=j(i(#-1,k),i(#-1,k,1)));
med(W) # W = the resulting vector
" rm.
@garagecoder, if you want to use warp
in a math expression, then maybe it’s better to
call the warp
command from the math expression, using the math function run()
,
and fill some images before the call, with the command draw()
?
Then get the result back with crop()
.
The draw/crop things are not that inefficient :), and you’ll ensure calling warp
will compute it in a multi-threaded way.
I may have found a display bug using first image from https://discuss.pixls.us/t/rescuing-thousands-of-images-from-a-blemished-life/18524/10
. Clicking on image[1] in individual view doesn’t bring me back to the multi-view.
gmic img502.jpeg afre_edge 1 autocrop_components ,,,0
Clicking the close button works as expected.
A tangential question. Sometimes I don’t want minimum area but rather max area in certain commands or vice versa. In sum, I think there are cases where constraining both min and max of something is useful.
Trying to search for a number in a set of numbers.
“isin()” is a helpful function, still I think better to return the number of the, say, first occurrence in the set (true!=0) !?
Or some sort of “where()” returning a boolean set could help either.
I use find function for that. For a example of usage, it’s somewhere on my tiler tool. Used to find where the value of 1 is found within row or column.
I want a function to rapidly find all number that are greater than 0 and return the sum of true condition, I may actually look into compiling gmic for this, but im working more on krita.
Then, you probably need find()
:
pos = find([3,2,1,0],2);
pos>=0?(
# Number found...
);
Easy:
A = [-1,1,-2,2,3];
n = sum(A>=0); # -> 2
print(n);
I did not know you could insert a conditional within sum, thanks.
Yes, thank you @David_Tschumperle and @Reptorian.
Copyright (c) 2008-2020, David Tschumperlé / GREYC / CNRS.
é The Man with the Golden Gun
You meant, the Windows shell, with no UTF-8 support…
The Windows console does have UTF-8 support, but most systems are configured to use DOS code-pages for backwards compatibility.
If you run chcp 65001
before running the G’MIC CLI, the UTF-8 copyright text will display correctly:
Copyright (c) 2008-2020, David Tschumperlé / GREYC / CNRS.
I could make a patch for the G’MIC CLI that sets the console to use UTF-8 for input and output.
That could be interesting yes.
I’ve planed to release G’MIC 2.9.1 tomorrow, but I may delay it.
Is it as simple as adding : SetConsoleOutputCP( 65001 );
in the main()
?
Nope, sounds like it doesn’t work
Yes, I discovered that also.
I also tried setlocale(LC_CTYPE, ".65001")
, but that did not work either.
The legacy Windows console (cmd.exe
) may just have buggy UTF-8 support, as I mentioned in my other post it works correctly if you set the code page to UTF-8 before starting the G’MIC CLI process.
SetConsoleOutputCP( 65001 )
works when using Microsoft’s new Windows Terminal, hopefully it will be included by default with a future version of Windows 10.
OK interesting. I’m planing to release 2.9.1 today then, if nothing helpful can be done about it.
- 2020/06/10: Release of G’MIC 2.9.1.