Page 1 of 1

feature request, concerning -trim in convert

Posted: 2007-01-31T12:59:50-07:00
by RetroJ
Hello,

My feature request is to be able to crop to the geometry that was the result of the last trim, with a single invocation of convert.

Anthony shows how to crop to the geometry of a trim via a subshell, at:

http://www.cit.gu.edu.au/~anthony/graph ... #trim_blur

Code: Select all

convert noisy.jpg -crop \
      `convert noisy.jpg -blur 0x10 -fuzz 15% -trim -format '%wx%h%O' info:` \
      +repage   noisy_trimmed_2.jpg

I had a situation where it would have been nice to be able to store the trim geometry and use it later in the same command. It was a case where I was generating both an ordinary image and mask image, in one convert command. Any changes to the size or page-offset of the ordinary image had to also be done to the mask image.

It is easy enough to use another approach to this problem, but I think this would be a useful feature.

Re: feature request, concerning -trim in convert

Posted: 2007-02-07T21:54:35-07:00
by anthony
We are basically waiting for ideas and implementations that allow you to extrat info from images in memory, to use a arguments of later options.

Things like what can be extrasted from format. See IM Examples, future proposals...
http://www.imagemagick.org/Usage/bugs/future/#settings
Some steps have been made for extracting colors to report in -format strings, but as yet not into general arguments.

PS: -fill and -stroke can now be images for pattern tiles rather than colors, obsoleting the current use of -tile in convert. IM examples still needs updating for this.

Re: feature request, concerning -trim in convert

Posted: 2007-02-09T15:03:51-07:00
by RetroJ
Ah, so there will be a variable-space implemented with the percent-sign syntax like that found in -format. I think that's an exellent idea, and I look forward to it.

Re: feature request, concerning -trim in convert

Posted: 2007-02-10T19:50:38-07:00
by anthony
Yes, but it has problems in that argument handling currently does not have access to the current image sequence. And in an API there is no standard current image sequence, so it may only be command line based if at all.

The whole thing needs a lot of thought.