I have an image for which I add a shadow.
Of course adding the shadow will increase the final image dimensions, but I'd like to know the relative position of the original image inside the final image (dx and dy shift). Is this possible ?
Image shadow and relative layers position
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image shadow and relative layers position
see http://www.imagemagick.org/script/comma ... php#shadow and http://www.imagemagick.org/Usage/blur/#shadow
The negative of +X+Y should tell you the offsets to your original, if I am not mistaken
The negative of +X+Y should tell you the offsets to your original, if I am not mistaken
Re: Image shadow and relative layers position
Thanks but it not what I'm looking for.
For instance you can specify an offset of 10,10 which makes the shadow looks at right bottom.
However, depending on the sigma value (the blur effect) the dimensions of the shadow layer may include completely the original image layer because the blur makes the shadow extents in all directions.
For instance you can specify an offset of 10,10 which makes the shadow looks at right bottom.
However, depending on the sigma value (the blur effect) the dimensions of the shadow layer may include completely the original image layer because the blur makes the shadow extents in all directions.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image shadow and relative layers position
Only other suggestion is to do a compare of the original image with the larger shadowed image and it will tell you the offset.
see
http://www.imagemagick.org/script/compare.php
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
In the latter, with current versions of IM, one must add -subimage-search.
see
http://www.imagemagick.org/script/compare.php
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
In the latter, with current versions of IM, one must add -subimage-search.
Re: Image shadow and relative layers position
Well may be I should explain more precisely what I want to do. May be there is another solution to do it.
After adding the shadow to the image, I'd like to extend the canvas of the resulted image, keeping the initial image centered in the canvas.
If I just do the extent after the shadow, then the whole image (initial+shadow) will be centered but the initial image will not.
That's why I need the offset between the image layer and the shadow layer, so I can extend the canevas with such values to have the initial picture centered in the canvas.
After adding the shadow to the image, I'd like to extend the canvas of the resulted image, keeping the initial image centered in the canvas.
If I just do the extent after the shadow, then the whole image (initial+shadow) will be centered but the initial image will not.
That's why I need the offset between the image layer and the shadow layer, so I can extend the canevas with such values to have the initial picture centered in the canvas.
Re: Image shadow and relative layers position
Thank you !