Offsets in geometry (from tutorial)

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
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Offsets in geometry (from tutorial)

Post by tmelorc »

Code: Select all

Version: ImageMagick 7.0.4-2 Q16 x86_64 2017-01-02 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP 
Delegates (built-in): bzlib freetype jng jpeg lzma png x zlib
I'm trying to learn how to use geometry features. Reading from https://www.imagemagick.org/script/comm ... p#geometry we have:

Offsets in geometry

Code: Select all

convert logo: -region '100x200+10+20' -negate wizNeg1.png
convert logo: -region '100x200-10+20' -negate wizNeg2.png
convert logo: -gravity center -region '100x200-10+20' \
  -negate wizNeg3.png
and quoting:
A negative offset can make sense in many cases. In the second example above, the offset is (-10,20), specified by -10+20. In that case, only the portion of the (virtual) rectangle obtained that lies within the image can be negated;
But I tried those 3 commands and the output is the same: the whole image was negated (I supposed that only the rectangular region should be negated).

Am I missing something?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Offsets in geometry (from tutorial)

Post by snibgo »

This may be a bug.

Try inserting "+region" after the negate.
snibgo's IM pages: im.snibgo.com
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: Offsets in geometry (from tutorial)

Post by tmelorc »

snibgo wrote:This may be a bug.

Try inserting "+region" after the negate.
No progress.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Offsets in geometry (from tutorial)

Post by fmw42 »

Is it possible that -region does not support gravity?
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Offsets in geometry (from tutorial)

Post by GeeMack »

fmw42 wrote:Is it possible that -region does not support gravity?
Maybe. Several months ago there was a discussion found at THIS link about "-region" and IM7.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Offsets in geometry (from tutorial)

Post by fmw42 »

Did you try using

Code: Select all

magick convert ...
Is there even gravity support for -region in IM 6?
tmelorc
Posts: 30
Joined: 2016-12-01T06:07:55-07:00
Authentication code: 1151

Re: Offsets in geometry (from tutorial)

Post by tmelorc »

fmw42 wrote:Did you try using

Code: Select all

magick convert ...
The same problem.

Thanks for helping and discussion but I'm only following the topic, since I have no deep knowledge to help to fix the possible bug/feature.

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

Re: Offsets in geometry (from tutorial)

Post by fmw42 »

You could post your question about whether -region supports -gravity to the Developers or Bugs forum and see what the IM developers say.
Post Reply