I need get size and coordinates of transparent area inside png image.
like 555x560+428+376 in some image.
And it works, but not always
original img http://kartinka.by/imagemagick/r0325.png
convert ./r0325.png -alpha extract -format "%@" info:
and result 1000x1000+0+0 <-- no coords
original img http://kartinka.by/imagemagick/r0051.png
convert ./r0051.png -alpha extract -format "%@" info:
and result 1299x945+0+0 <-- no coords
why on than images alpha extract does not work, how to make it work ?
Help extract alpha coordinates
-
- Posts: 12
- Joined: 2011-07-03T04:02:30-07:00
- Authentication code: 8675308
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Help extract alpha coordinates
If you "-alpha extract" to a new output file, and look at that image with Gimp, and read the values with the eyedropper tool, you will see the values vary. That's why a simple "trim" doesn't trim anything.
"-fuzz X%" will take care of that.
I suppose you want to put an image within the frame. But the frame isn't entirely opaque, so you should probably fix that, eg by alpha extract, threshold and alpha copy.
"-fuzz X%" will take care of that.
I suppose you want to put an image within the frame. But the frame isn't entirely opaque, so you should probably fix that, eg by alpha extract, threshold and alpha copy.
snibgo's IM pages: im.snibgo.com
-
- Posts: 12
- Joined: 2011-07-03T04:02:30-07:00
- Authentication code: 8675308
Re: Help extract alpha coordinates
thanks snibgo, it great, it works !
i think fuzz 10 enough for all same images
i think fuzz 10 enough for all same images
-
- Posts: 12
- Joined: 2011-07-03T04:02:30-07:00
- Authentication code: 8675308
Re: Help extract alpha coordinates
Can it take coordinates of two areas from http://kartinka.by/imagemagick/_0103.png
Or it is more difficult ?
Or it is more difficult ?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Help extract alpha coordinates
That image has two areas, one in the top half and the other in the bottom half. So "-crop x50%" to split the image.
snibgo's IM pages: im.snibgo.com