Release of G'MIC 3.0

Cut the following from updateXXX.gmic and paste it into user.gmic.

#@cli gradient_norm
#@cli : Compute gradient norm of selected images.
#@cli : $ image.jpg gradient_norm equalize
#@cli : $$
gradient_norm :
e[^-1] "Compute gradient norm of image$?."
repeat $! l[$>] g sqr s c + sqrt endl done

help will display:

[gmic] Command 'gradient_norm' has no description; did you mean 'jr_gradient_norm' ?). Try 'gmic -h' for global help.

Hum, it works for me, with 2.9.2_pre.

Something happened to the website’s background. Now it is hard to read the text.

Gimp 2.10.20 kubuntu 18.04 - I see some new G’mic code for 2.9.2_pre so a compile this morning.

Interactive color curves Lab and Lch give this ?

Is this my installation or is it a bug ?

It’s a bug. I’m investigating…
Thanks for the report !!

Bug fixed:
https://github.com/dtschump/CImg/commit/be4ac64c1031ca291741bbd49668349edb7f5fde

I’ll update the sources of the pre-release packages for 2.9.2, on the website.
Thanks again @rich2005 !

1 Like

I mean, even if there were greater reliance on ImageMagick, it’s not as if that’s in any way a problem, remotely unusual, or anything other than the entire point of the open-source community in the first place! Heck, there’s nothing worse than someone needlessly reinventing the wheel with their own implementation of solved problems.

And it’s not like ImageMagick doesn’t equally “stand on the shoulders of giants” as well. Their code includes a robust system of Delegates they defer to for handling certain operations. The delegate users are most likely to have encountered is Inkscape, which IM uses for all PDF rendering, but that’s not remotely the sole case. The iist of external Delegates can be obtained by passing -list Delegate to any IM command, and for IM 6.9.11-27 on my Fedora 32 system, the lengthy output that results is, in full:

$ identify -list Delegate

Path: /etc/ImageMagick-6/delegates.xml

Delegate                Command
-------------------------------------------------------------------------------
    blender =>          "blender' -b '%i' -F PNG -o '%o''\n'convert' -concatenate '%o*.png' '%o"
        bmp<= jxr       "/usr/bin/mv '%i' '%i.bmp'; 'JxrEncApp' -i '%i.bmp' -o '%o.jxr'; /usr/bin/mv '%i.bmp' '%i'; /usr/bin/mv '%o.jxr' '%o"
        bmp<= wdp       "/usr/bin/mv '%i' '%i.bmp'; 'JxrEncApp' -i '%i.bmp' -o '%o.jxr'; /usr/bin/mv '%i.bmp' '%i'; /usr/bin/mv '%o.jxr' '%o"
        bpg =>          "bpgdec' -b 16 -o '%o.png' '%i'; /usr/bin/mv '%o.png' '%o"
        cdr =>          "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
        cgm =>          "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
 dng:decode =>          "ufraw-batch' --silent --create-id=also --out-type=png --out-depth=16 '--output=%u.png' '%i"
        doc =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       docx =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        dot =>          "dot' -Tsvg '%i' -o '%o"
        dvi =>          "dvips' -sstdout=%%stderr -o '%o' '%i"
        dxf =>          "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
        eps<=>pdf       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 '-sDEVICE=pdfwrite' '-sOutputFile=%o' '-f%i"
        eps<=>ps        "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=ps2write' '-sOutputFile=%o' '-f%i"
        fig =>          "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
        hpg =>          "hp2xx' -sstdout=%%stderr -m eps -f `basename '%o'` '%i';     /usr/bin/mv -f `basename '%o'` '%o"
       hpgl =>          "hp2xx' -sstdout=%%stderr -m eps -f `basename '%o'` '%i';     /usr/bin/mv -f `basename '%o'` '%o"
        htm =>          "html2ps' -U -o '%o' '%i"
       html =>          "html2ps' -U -o '%o' '%i"
https:decode =>          "curl' -s -k -L -o '%u.dat' 'https:%M"
       ilbm =>          "ilbmtoppm' '%i' > '%o"
        jpg<= lep       "lepton' '%i' '%o"
        jxr =>          "/usr/bin/mv '%i' '%i.jxr'; 'JxrDecApp' -i '%i.jxr' -o '%o.pnm'; /usr/bin/mv '%i.jxr' '%i'; /usr/bin/mv '%o.pnm' '%o"
        lep =>          "lepton' '%i' '%o"
       miff<= show      "display' -immutable -delay 0 -title '%M' '%i"
mpeg:decode =>          "ffmpeg' -nostdin -v -1 -i '%i' -vframes %S -vcodec pam -an -f rawvideo -y '%u.pam' 2> '%u"
        odt =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        pdf<=>eps       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sPDFPassword='%a' '-sDEVICE=eps2write' '-sOutputFile=%o' '-f%i"
        pdf<=>ps        "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=ps2write' -sPDFPassword='%a' '-sOutputFile=%o' '-f%i"
        png<= bpg       "bpgenc' -b 12 -q '%~' -o '%o' '%i"
        png<= webp      "cwebp' -quiet %Q '%i' -o '%o"
        pnm<= trace     "potrace' --svg --output '%o' '%i"
        pnm<= ilbm      "ppmtoilbm' -24if '%i' > '%o"
        ppt =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       pptx =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
         ps<= prt       "lpr' '%i"
         ps<=>eps       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=eps2write' '-sOutputFile=%o' '-f%i"
         ps<=>pdf       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pdfwrite' '-sOutputFile=%o' '-f%i"
         ps<= print     "lpr '%i"
      shtml =>          "html2ps' -U -o '%o' '%i"
        sid =>          "mrsidgeodecode' -if sid -i '%i' -of tif -o '%o' > '%u"
        svg =>          "rsvg-convert' -o '%o' '%i"
       tiff<= launch    "gimp' '%i"
        wdp =>          "/usr/bin/mv '%i' '%i.jxr'; 'JxrDecApp' -i '%i.jxr' -o '%o.bmp'; /usr/bin/mv '%i.jxr' '%i'; /usr/bin/mv '%o.bmp' '%o"
       webp =>          "dwebp' -pam '%i' -o '%o"
        xls =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       xlsx =>          "libreoffice' --headless --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"

Benefitting mutually by relying on each other’s strengths, it’s all the rage!

@FeRDNYC Welcome to the forum.

David was clarifying IM functionality in G’MIC and in no way saying that it is a bad thing.

May be prudent to cite the paper.

  • 2020/09/03 : G’MIC 2.9.2 Released!

1 Like

Just pointing out that this is kind of ambiguous.

gmic sp tiger,flower r. ..,$var

If $var>6, then the height is resized, otherwise it chooses the interpolation.


Sometimes I want to retrieve a stat from a channel. I try i0M or iM0 for instance but it isn’t supported. Is there a way to do it, or is this a feature request?

1 Like

@afre, why not use this?

sh[ind] channel_val
stat_val=iM#-1
rm.

That is what I would do though it would be nice to avoid the need to use shared.

Indeed, that’s not good. Never noticed that.
I think I’ll have to remove the syntax resize [img],interpolation.
It’s less used than the other one, and it can be easily replaced by resize [img],[img],[img],[img],interpolation. It’s a bit longer, but at least, it removes the ambiguity, and this can be replaced by a new custom command if necessary.

Two options there:

  • If you are designing a pipeline, out of the math evaluator: sh. 0 iM0={iM} rm.
  • If you want to do it inside the math evaluator: iM0 = max(crop(#0,0,0,0,0,w#0,h#0,d#0,1))

So, some news:

  • I’ve started working on next version 2.9.3 of G’MIC.
  • In command resize, I’ve removed the support of the argument list [image],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac, to get rid of the possible ambiguity with the other possible arguments of resize.
  • In the stdlib, I’ve added a command resize_as_image (eq. to ri) that can be used as a replacement of the previous syntax (just add an i to the r with the old syntax, and it’s OK).
  • I’ve started replacing all the previous uses of this old syntax of resize in the .gmic files. I may have missed some. We’ll have to check if all filters work.
  • I’m trying to post binary packages for 2.9.3_pre during the day.
1 Like

Can future GMIC utilize Vulkan or DXR library for fast almost instant computation?

Not planed no.

In docs, diagonal's preview isn’t correct.

Just installed hte 2.9.3 pre-release, David. So far, so good. Seems spiffy too. :slight_smile:

I’m just trying the new option “bool” with raw files:

gmic osteo_ k. o /tmp/test.raw,bool i /tmp/test.raw,bool l. s y,-128 a x endl d

The result shows some differences, possibly I have forgotten another option?

Hmm, ja, “transpose” the result or each row helped!

There should be no differences. Why do you need to transpose ?