How to know the image's transparent space?

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?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to know the image's transparent space?

Post by fmw42 »

My error. Snibgo is correct -- it could be any color. Any perfectly constant color will trim to 0x0.
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: How to know the image's transparent space?

Post by niyanwen »

but if plus x,y offset equals image's full weight and height ? can we assume it is transparent?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to know the image's transparent space?

Post by snibgo »

Try them:

Code: Select all

magick -size 10x10 xc:White -format %@ info:
magick: geometry does not contain image `' @ warning/attribute.c/GetImageBoundingBox/240.
0x0+10+10

magick -size 10x10 xc:None -format %@ info:
magick: geometry does not contain image `' @ warning/attribute.c/GetImageBoundingBox/240.
0x0+10+10
There is no difference betwen "none" (transparent black) and "white".
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to know the image's transparent space?

Post by fmw42 »

The +X+Y = +10+10 is off the image just past the last pixel (at +9+9). It is not the width and height. It is an offset.
Post Reply