Crop based on color
Crop based on color
How would I crop one of the above images on the pink border (remove pink border as well)? I split the gif into individual frames as well. Seems like it should be easy but I cant get it working.
Version: ImageMagick 6.9.0-3 Q16 x86_64 2015-01-09 http://www.imagemagick.org
OS: MacOSX
Last edited by kboehme1 on 2016-12-13T08:16:22-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Crop based on color
What is your IM version and platform? Please always provide that, since syntax differs.
In Unix syntax, try this
In Unix syntax, try this
Code: Select all
convert pillAnim.gif[0] \
\( +clone -fuzz 20% -fill white +opaque "rgb(255,108,115)" -fill black +opaque white \
-morphology smooth octagon:1 -morphology erode octagon:1 \
-fuzz 0 -fill black -draw "color 0,0 floodfill" \) \
-alpha off -compose copy_opacity -composite -fuzz 10% -trim +repage \
result.png
Re: Crop based on color
Thank you very much that works great! For some images it looks like I will need to tweak the fuzz factor a bit. Also edited my question.fmw42 wrote:What is your IM version and platform? Please always provide that, since syntax differs.
In Unix syntax, try this
Code: Select all
convert pillAnim.gif[0] \ \( +clone -fuzz 20% -fill white +opaque "rgb(255,108,115)" -fill black +opaque white \ -morphology smooth octagon:1 -morphology erode octagon:1 \ -fuzz 0 -fill black -draw "color 0,0 floodfill" \) \ -alpha off -compose copy_opacity -composite -fuzz 10% -trim +repage \ result.png