Photoshop filter "minimum" equivalent in IM ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
badabou
Posts: 54
Joined: 2008-06-23T06:12:24-07:00

Photoshop filter "minimum" equivalent in IM ?

Post by badabou »

Hello,

There's there an equivalent filter in Photoshop "minimum" (filter > others > minimum) in Imagemagick ?

Here is an preview :

Image

Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Photoshop filter "minimum" equivalent in IM ?

Post by fmw42 »

convert image -statistic minimum 3x3 output

3x3 corresponds to radius=1
5x5 corresponds to radius=2
etc

see
http://www.imagemagick.org/script/comma ... #statistic
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Photoshop filter "minimum" equivalent in IM ?

Post by anthony »

In a similar way with more control on the 'neighbourhood' use Morphology Erode.
Or if you want to preserve colors ErodeIntensity whcih compared pixels using the grayscale intensity of the pixel as a whole.
(Eventually I'd like a method that defines what 'intensity' means for a number of operators.

See Morphology, Intensity Variants
http://www.imagemagick.org/Usage/morphology/#intensity
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
badabou
Posts: 54
Joined: 2008-06-23T06:12:24-07:00

Re: Photoshop filter "minimum" equivalent in IM ?

Post by badabou »

Thanks.

But I use this version of imagemagick that does not support this operator, you have there an alternative ?

# convert -version
Version: ImageMagick 6.5.9-3 2012-11-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features:
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Photoshop filter "minimum" equivalent in IM ?

Post by fmw42 »

see my response above, though -statistic, may be too new also as I think it was only created at IM 6.6.8-6

Your version of IM is way too old (more than 200 versions). Perhaps you should consider upgrading.

Have you tried

convert image -morphology erode diamond:1 output


Your version may just be enough for that
badabou
Posts: 54
Joined: 2008-06-23T06:12:24-07:00

Re: Photoshop filter "minimum" equivalent in IM ?

Post by badabou »

Thanks, this work !

For your information, when I wanted to update imagemagick, imagick extension not working properly with my scripts.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Photoshop filter "minimum" equivalent in IM ?

Post by fmw42 »

badabou wrote:Thanks, this work !

For your information, when I wanted to update imagemagick, imagick extension not working properly with my scripts.
Try reloading Imagick and use the latest version http://pecl.php.net/package/imagick/3.1.0RC2
Post Reply