Page 1 of 1

Outline Contour

Posted: 2016-09-13T04:26:26-07:00
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!

Re: Outline Contour

Posted: 2016-09-13T05:46:25-07:00
by snibgo
For you image, I get "Error (404) We can't find the page you're looking for."

Re: Outline Contour

Posted: 2016-09-13T05:58:14-07:00
by Arise
I hope I fixed the image.

Re: Outline Contour

Posted: 2016-09-13T08:21:58-07:00
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