Outline Contour

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
Arise
Posts: 3
Joined: 2016-09-13T03:56:59-07:00
Authentication code: 1151

Outline Contour

Post by Arise »

Hi!

I'm trying to add a slight contour to the outline/silhouette of one image.
Image

What I would like would be to:
1. take the exterior pixels
I've tried with

Code: Select all

  convert input.png ^
          -channel A -virtual-pixel transparent ^
          -morphology EdgeIn Diamond ^
          strokedOutMorph.png
2. darken/saturate the exterior

Code: Select all

convert strokedOutMorph.png ^
          -colorspace HSL -channel Saturation -negate -evaluate multiply 0.8 -negate -colorspace RGB ^
          strokedOutMorph_saturated.png
3. dilate the exterior by 1-2 pixels (but I think 1 pixel is enough???) keeping the colors, then apply some transparency to this thin contour.
The problem is I'm not sure how to do that? I need some help here.

4. compose the final image by overlaying the saturated contour and the dilated contour over the original image.

Thanks!
Last edited by Arise on 2016-09-13T05:57:58-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Outline Contour

Post by snibgo »

For you image, I get "Error (404) We can't find the page you're looking for."
snibgo's IM pages: im.snibgo.com
Arise
Posts: 3
Joined: 2016-09-13T03:56:59-07:00
Authentication code: 1151

Re: Outline Contour

Post by Arise »

I hope I fixed the image.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Outline Contour

Post by snibgo »

Try these:

Code: Select all

convert ^
  strokedOutMorph_saturated.png ^
  -blur 1x1 ^
  -channel A -level 25%%,40%% +channel ^
  s.png

convert ^
  robot.png ^
  s.png ^
  -compose Over -composite ^
  s2.png
snibgo's IM pages: im.snibgo.com
Post Reply