• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Alpha Channel availability of a Image  RSS feed

 
Santhana Arunkumar
Greenhorn
Posts: 5
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a C based Image Processing Lib called ImageMagic. http://www.imagemagick.org/, I have used the Identity command of that lib to get the Alpha Channel availability of a Image.

Is it possible to java a JNI inplementation for that? It looks like JMagic library in writen for the Convert command of ImageMagix.

Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

If JMagick doesn't do what you need done, you might check out http://im4java.sourceforge.net/. It "supports most ImageMagick commands".
 
Santhana Arunkumar
Greenhorn
Posts: 5
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dif,

I found a way in new version of ImageMagick and Jmagick.

Version Details:

ImageMagick 6.8.9-7
JMagick 6.7.7


According to http://www.w3.org/TR/PNG-Chunks.html

Color type is a single-byte integer that describes the interpretation of the image data. Color type codes represent sums of the following values: 1 (palette used), 2 (color used), and 4 (alpha channel used). Valid values are 0, 2, 3, 4, and 6.
Bit depth restrictions for each color type are imposed to simplify implementations and to prohibit combinations that do not compress well. Decoders must support all legal combinations of bit depth and color type. The allowed combinations are:
Color Allowed Interpretation
Type Bit Depths

0 1,2,4,8,16 Each pixel is a grayscale sample.

2 8,16 Each pixel is an R,G,B triple.

3 1,2,4,8 Each pixel is a palette index;
a PLTE chunk must appear.

4 8,16 Each pixel is a grayscale sample,
followed by an alpha sample.

6 8,16 Each pixel is an R,G,B triple,
followed by an alpha sample.

If we check ColorType and Bit Depth we can conclude that alpha is available.

We can get the colorType and Bit Depth from the Image :--

 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Santhana Arunkumar wrote:I found a way in new version of ImageMagick and Jmagick.

Thanks for that Santhana.

It all goes waaay over my head, not being an "image geek"; but I'm sure someone may find it useful. Have a cow.

Winston
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!