Search found 8 matches

by guido.pettinari
2019-08-09T09:25:42-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Crop around highest detail region while keeping the AR

I confirm that the remaining (known) bugs have been corrected, and that I have succesfully used the script on my products :-)

Thank you again Fred and snibgo for helping me out on this!

Have a nice day,
Guido
by guido.pettinari
2019-08-02T11:59:35-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Crop around highest detail region while keeping the AR

I updated the script so that now it works also with non-square AR + it always keeps the AR in the zero padding case. Details about the script at https://github.com/coccoinomane/trim-ratio, latest zip here => https://github.com/coccoinomane/trim-ratio/archive/v1.1.zip There still is a bug whereby non...
by guido.pettinari
2019-08-02T08:07:55-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Crop around highest detail region while keeping the AR

Thanks snibgo!
That snippet is handy.

By the way, I have found a bug: when I adapt the image to the original AR, I should be checking whether there's enough space in both directions, rather than just adding half of the pixels to each direction.
I will fix it in the weekend :-)
by guido.pettinari
2019-08-02T06:55:12-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Crop around highest detail region while keeping the AR

Hello! Thanks Fred for the suggestion :-) I wrote down a Bash script called trim-ratio which trims an image around the highest detail region without changing its aspect ratio. The complications were 1) to maintain the same AR and 2) to control how much is trimmed. I ended up manipulating the crop pa...
by guido.pettinari
2019-07-30T12:15:30-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Crop around highest detail region while keeping the AR

Thank you very much snibgo and Fred , your help is very much appreciated! If I am not mistaken, Fred's snippet is step 0 in the process outlined by snibgo: find the object's bounding rectangle . This is super helpful because now I can do step 1, that is, pad the bounding rectangle. My doubt is how t...
by guido.pettinari
2019-07-29T02:33:16-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Crop around highest detail region while keeping the AR

If you have good contrast between the foreground and background just use magick input -fuzz XX% -trim +repage output See XX between 0 and 100 with as small a value that will trim the background as desired. Thank you very much Fred for your reply! I have tried many different values of fuzz XX%. At 7...
by guido.pettinari
2019-07-28T09:41:48-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

Re: Enlarge hightest detail region

Hi snibgo, thank you for your quick reply! I am using IM 7.0.8-56 on a Mac 10.14, but if needed I can switch versions of both IM and OS. You say you want to "enlarge" a region, but your examples show no enlargement. Instead, they seem to crop most of the gray background. Yes, what I really...
by guido.pettinari
2019-07-28T08:49:27-07:00
Forum: Users
Topic: [SOLVED] Trim around highest detail region while keeping the AR
Replies: 13
Views: 21576

[SOLVED] Trim around highest detail region while keeping the AR

Update August 2019 The problem was solved thanks to the contributions of Fred & snibgo! There is now a script on Github that achieves my original need, and a little bit more => https://github.com/coccoinomane/trim-ratio 🙂 Original thread Hello! As this is my first post, I wish to thank you for ...