showkernel=1 not outputting

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
afre
Posts: 57
Joined: 2014-01-22T15:02:53-07:00
Authentication code: 6789

showkernel=1 not outputting

Post by afre »

In my discussion with snibgo on another forum, his example

Code: Select all

convert xc: -define showkernel=1 ^
  -morphology Convolve:0 Gaussian:0x2 null: 2>&1 | findstr Kernel
doesn't output anything; i.e., the part up to null:. If I do

Code: Select all

convert xc: -define showkernel=1 ^
  -morphology Convolve:0 Gaussian:0x2 info:
the output is

Code: Select all

xc: XC 1x1 1x1+0+0 16-bit sRGB 0.000u 0:00.093
So:
1. There should be some sort of output since showkernel=1.
2. The kernel given by info: should not be 1x1 in size.

I installed the latest IM and got the same result.

As an aside, I noticed that the installer places IM in the Windows system path instead of the user one. Is there a reason for that?
ImageMagick 7.0.7-25 Q16 x64 2018-03-04 · Cipher DPC HDRI Modules OpenMP · Windows 7
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: showkernel=1 not outputting

Post by snibgo »

Ha, fancy meeting you here!

For IM v7, you should use "magick" instead of "convert".

The command (with "convert") works fine for me with IM v6.9.5-3. But v7.0.3-5 with "magick" gives me no text at all. This looks like a bug.


The default Windows installation directory is something like "C:\Program Files\", which makes it usable by anyone. At installation, you should be able to choose any directory you want.

EDIT:
afre wrote:2. The kernel given by info: should not be 1x1 in size.
"info:" doesn't show the kernel, but the image. You specified the image to be "xc:" with no size specified, so the size defaulted to 1x1.

In ImageMagick, kernels are not images. The only direct way of getting data about a kernel is with "-define showkernel=1". This is different to G'MIC, where a kernel is an image (with only one channel), and the same operations can be made to kernels as to ordinary images.
snibgo's IM pages: im.snibgo.com
afre
Posts: 57
Joined: 2014-01-22T15:02:53-07:00
Authentication code: 6789

Re: showkernel=1 not outputting

Post by afre »

Thanks for confirming this bug. I installed the legacy convert since that is what I am used to. By path, I meant the ones under environment variables.
ImageMagick 7.0.7-25 Q16 x64 2018-03-04 · Cipher DPC HDRI Modules OpenMP · Windows 7
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: showkernel=1 not outputting

Post by magick »

Use -define morphology:showKernel=1.
afre
Posts: 57
Joined: 2014-01-22T15:02:53-07:00
Authentication code: 6789

Re: showkernel=1 not outputting

Post by afre »

Thanks! I was looking at the IM v6 Examples where there are 3 ways to define this but Command-line Options does consistently have the morphology: prefix.
ImageMagick 7.0.7-25 Q16 x64 2018-03-04 · Cipher DPC HDRI Modules OpenMP · Windows 7
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: showkernel=1 not outputting

Post by fmw42 »

It seems to be wrong here https://www.imagemagick.org/Usage/convo ... el_scaling and I have notified the author. It seems to be correct here https://www.imagemagick.org/script/comm ... php#define. Is there some other place that it shows wrong?
afre
Posts: 57
Joined: 2014-01-22T15:02:53-07:00
Authentication code: 6789

Re: showkernel=1 not outputting

Post by afre »

Oops, I should have provided the links. This is where the 3 ways are shown https://www.imagemagick.org/Usage/morph ... showkernel and where every example uses -define showkernel=1 like on the convolve page.

Code: Select all

    -define morphology:showkernel=1    
    -define convolve:showkernel=1    
    -define showkernel=1
ImageMagick 7.0.7-25 Q16 x64 2018-03-04 · Cipher DPC HDRI Modules OpenMP · Windows 7
Post Reply