• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting Alpha Channel availability of a Image

 
Greenhorn
Posts: 5
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :--

 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic