Get property for Image

Hi Team,

We have a requirement to get following property from Image

  1. Height of image in points
  2. Width of image in points
  3. Color space used in Image

Thanking You
Priya Dharshini J P

Hi Priya Dharshini,

I have observed your requirements and suggest you to please try using following sample code on your end to serve the purpose. I hope the shared information will be helpful.

JpegImage jpgImage = (JpegImage)Image.load(path + “fx1.jpg”);
System.out.println("Height: “+jpgImage.getHeight()+”, Width: “+jpgImage.getWidth()
+”, ColorSpace: "+jpgImage.getRawDataFormat().getPixelFormat());

Many Thanks,

Hi,


Thank you for the timely reply. I further have a request.

In the above mentioned code, for colorspace:

jpgImage.getRawDataFormat().getPixelFormat()
Output recieved is

ColorSpace: 3

Can you help me out what this code means?

Regards

Priya Dharshini J P

Hi Priya Dharshini,

I suggest you to please visit PixelFormat API reference guide page. The enumerator values start from 0. I hope the shared information will be helpful.

Many Thanks,