Crop based on clolor

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
frazior
Posts: 1
Joined: 2015-06-17T09:58:16-07:00
Authentication code: 6789

Crop based on clolor

Post by frazior »

Image
Image


is it possible to crop the number in the middle of the frame and get something like this :

maybe crop the black pixels surrounded by white ?

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

Re: Crop based on clolor

Post by fmw42 »

I do not see an automatic way, since your image is very grainy, compressed and the colors are too close to your "black" which is not really black.

Closest I have come to isolate the "black" letters is:

Code: Select all

convert majick.jpg -morphology smooth octagon:1 -fuzz 5% -fill white +opaque "rgb(65,65,65)" -trim +repage result.png
Post Reply