Check if Corners are transparent
Posted: 2009-06-01T23:06:04-07:00
How would I check if an Image has atleast one corner pixel that is transparent?
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=13885
convert each of the four corner pixels, one at a time to txt: format and look at the informationgotskill10 wrote:How would I check if an Image has atleast one corner pixel that is transparent?
Code: Select all
convert grad100_at50.png -roll +1+1 -crop 2x2+0+0 +repage txt:
or two corners are white and two are transparent.# ImageMagick pixel enumeration: 2,2,65535,rgba
0,0: (65535,65535,65535,65535) #FFFFFFFFFFFF white
1,0: ( 0, 0, 0, 0) #0000000000000000 none
0,1: (65535,65535,65535,65535) #FFFFFFFFFFFF white
1,1: ( 0, 0, 0, 0) #0000000000000000 none
neat way to get only the 4 cornersconvert grad100_at50.png -roll +1+1 -crop 2x2+0+0 +repage txt: