Search found 13 matches

by Karyudo
2018-06-10T10:12:33-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Yeah, I've already corrected it. I had to test whether the results came back the same, anyway, and I only have the one instance, so it's not onerous to get it right.
by Karyudo
2018-06-10T07:27:45-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Thanks, snibgo, that should save me hours of trial and error later today! Your "-level" syntax is wrong. The docs http://www.imagemagick.org/script/comma ... .php#level say the elements should be separated by commas, not slashes. Somebody should tell IM, then, because slashes work! (I look...
by Karyudo
2018-06-09T20:29:10-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Heh. I actually did use Windows syntax (i.e. I took the "\" off the end of each line to make it one long command), but edited it back for the post so that it didn't need a horizontal scroll bar.... I hope that doesn't mean some of the stuff in the middle that I don't quite understand (e.g....
by Karyudo
2018-06-09T18:10:09-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

OK, that was a little hard to parse, but I think I got there in the end. That result looks pretty great. I fiddled just a little, and am now using: magick "image_0.jpg" -background "gray(60)" -deskew 40% +repage -write mpr:img \ -morphology open octagon:2 -fuzz 35% -set option:cr...
by Karyudo
2018-06-09T10:54:29-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

This is an image that gets cropped poorly: https://www.dropbox.com/s/hzufilf9ndz2tuq/E10250_0.jpg It's that speck up in the top left that messes with the result. I figure it'd be better to worry about the problem of too many Hough lines once actually having too many Hough lines is the problem—and th...
by Karyudo
2018-06-08T15:25:11-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Well, that's disappointing: this single (if lengthy but elegant) line of IM script worked well on exactly one image before I hit problems again. The next image I tried has a little piece of white lint on the black background, and of course it gets included as part of the image worth keeping, so the ...
by Karyudo
2018-06-07T20:32:22-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Ooh! That's definitely better. Going to play around with this....

Thanks for persisting with me!
by Karyudo
2018-06-07T19:15:07-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

I have now. Adding "-fuzz XX% - trim +repage" seems to do either nothing or almost nothing (fuzz = 1% to 87%), something—but not the right thing (fuzz = 88%), crop the whole image file except for a line segment of width 1 pixel (fuzz = 89% or 90%), or even crop everything except for a sing...
by Karyudo
2018-06-06T22:02:21-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Well, dammit. Thanks very much for the code snippets, but I think I'm just about officially way out of my league. I can just barely follow the batch file, but I have serious doubts as to my ability to synthesize a complete solution from even the copious code chunks that do the heavy lifting. Especia...
by Karyudo
2018-06-05T18:02:24-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

I did even more searching, and this is not the first time this type of problem has been asked about and only sort of half-answered (see also https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=28434 , in particular). I don't suppose there's a solution out there someplace that actual...
by Karyudo
2018-04-13T07:26:27-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

That code worked pretty well on a few more test images, actually, despite the sub-par background. I tried larger values of fuzz, and that didn't work as well. Smaller values seemed about the same. Deskewing seems to be rock-solid. But overall, the strategy doesn't seem to do what I would do manually...
by Karyudo
2018-04-12T20:22:13-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Re: Batch autocrop images to fixed size?

Here are a couple of examples that I processed manually: Original files: https://www.dropbox.com/s/2i052ek34f0v5lt/Sample%201%20-%20G82217_01_Original.jpg?dl=0 https://www.dropbox.com/s/ch1e0u70q8umgjn/Sample%202%20-%20G82251_01_Original.jpg?dl=0 Deskewed using IM: https://www.dropbox.com/s/nuihjr55...
by Karyudo
2018-04-11T21:57:18-07:00
Forum: Users
Topic: Batch autocrop images to fixed size?
Replies: 30
Views: 16790

Batch autocrop images to fixed size?

I'd like to deskew and auto-crop several thousand images of postal covers on a black background. Ideally, I'd want all the processed output images to be the same pixel dimensions. The deskewing I've figured out from other threads: magick convert g82217.jpg -deskew 40% g82217_deskew.jpg works perfect...