Hello there,
Just a quick message to describe some cool improvements I’ve made today on commands autocrop
and autocrop_coords
.
These commands allows respectively to automatically crop the content of an image, according to a uniform background color (either specified or automatically guessed), or to just return the corresponding cropping coordinates without actually applying the crop operation.
Like this:
$ gmic 400,400,1,3 fill_color 64,128,255 ellipse 50%,50%,120,120,0,1,255 +autocrop
Here’s what I did today:
- Basically, I’ve recoded both commands
autocrop
andautocrop_coords
from scratch, asstdlib
commands. - This means
autocrop
won’t be a native command anymore. Expect then a bit of slow down (still reasonnable I think) when usingautocrop
. It’s sometimes even faster on larger image, as it’s now implemented as a multi-threaded operation. - Command
autocrop_coords
was already astdlib
command, so its state does not change. - The interesting thing is that I’ve been able to add a new
axes
argument, that can be specified to tell G’MIC along which axes the autocrop must be done (including the spectrum axisc
which was not possible before). So for instance :
$ gmic shape_cupid 300 frame xy,30,0 +autocrop[0] x +autocrop[0] y +autocrop[0] xy
Having this option to specify which axes must be considered for the autocrop operation is way more flexible than before.
- This new
axes
option also exists for commandautocrop_coords
.
Well, that’s it. I’ve updated the stdlib
, so a simple $ gmic update
should make this new autocrop_coords
available.
As for the autocrop
command, as it was a native one before (therefore not replaceable by a stdlib
command), you’ll have to update your G’MIC binaries to be able to use it with the new axes
option.
Perfect timing: I’ve updated the pre-release binaries also today: Index of /files/prerelease
Let me know what you think about this.