Image Data Functions

Functions providing a plethora of interesting image data.

class get_image_data.JpgTif(attribute, image)

A class to read the Exif data from a JPG or TIF file.

aspectRatio()

Aspect ratio calculation Calculate the aspect ratio of the image.

Parameters:
  • w (integer) – the width of the image.

  • h (integer) – the height of the image.

Returns:

the aspect ratio of the image, width to height.

Return type:

two integers

aspectRatioRounded()

Aspect ratio calculation rounded Calculate the aspect ratio of the image rounded to the nearest integer.

Parameters:
  • w (integer) – the width of the image.

  • h (integer) – the height of the image.

Returns:

the rounded aspect ratio of the image, width to height.

Return type:

two integers

channels()

Number of channels. Calculates the number of channels.

Args:

Returns:

The number of channels.

Return type:

integer

colour_mode()

Colour mode of the image. Returns the colour mode of the image.

Args:

Returns:

The colour mode.

Return type:

string

depth()

Bit-Depth per channel. Calculates the bit-depth per channel.

Args:

Returns:

The bit-depth per channel.

Return type:

integer

depth_per_pixel()

Depth per pixel. Calculates the depth per pixel.

Parameters:
  • depth (integer) – the depth per channel

  • channels – the number of channels

Returns:

The depth per pixel.

Return type:

integer

height()

Height of the image. Returns the height of the image.

Parameters:

() (attribute) –

Returns:

The height of the image.

Return type:

integer

megapixels()

Megapixel calculation Returns the number of megapixels within the image.

Parameters:
  • w (integer) – width of the image

  • h (integer) – height of the image

Returns:

The number of megapixels within the image.

Return type:

integer

width()

Width of the image. Returns the width of the image.

Parameters:

() (attribute) –

Returns:

The width of the image.

Return type:

integer