Different Results from 6.8.9-9 vs 6.9.9-40

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
terr
Posts: 2
Joined: 2018-04-21T01:05:34-07:00
Authentication code: 1152

Different Results from 6.8.9-9 vs 6.9.9-40

Post by terr »

I am trying to do a convert on an image of a document so that it cleans up the noise and lets the text standout for OCR. I am running ImageMagick version 6.9.9-40 locally and get good results. When I run the same call in a Google Function which uses version 6.8.9-9 I get a totally different result. I am not sure if this is due to the version or something else.

How much of a difference is there when running this command on these two versions?

convert bill.jpg -colorspace gray -lat 60x60-2% -define connected-components:mean-color=true -define connected-components:area-threshold=12 -connected-components 4 -depth 2 -compress Group4 bill-mod.jpg

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

Re: Different Results from 6.8.9-9 vs 6.9.9-40

Post by fmw42 »

Please post your bill.jpg image to some free hosting service and put the URL here so we can test your command.

Note that -connected-components was only officially available as of 6.8.9.10. So you are one version short. It may have been there in the previous version but unfinished or buggy.
terr
Posts: 2
Joined: 2018-04-21T01:05:34-07:00
Authentication code: 1152

Re: Different Results from 6.8.9-9 vs 6.9.9-40

Post by terr »

That was exactly it. I removed all reference to connected-components and even though the image has more noise it still is very good to prepare it for OCR.

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

Re: Different Results from 6.8.9-9 vs 6.9.9-40

Post by fmw42 »

You can try cleaning small noise spots using -morphology. If you post an example input, perhaps we can suggest another command.
Post Reply