Package FreeImagePy :: Module FreeImagePy :: Class freeimage
[show private | hide private]
[frames | no frames]

Type freeimage

object --+
         |
        freeimage

Known Subclasses:
Image

FreeImage class wrapper

The method with the first line uppercase are internal library methods the other one are internal method for help the user
Authors:
Michele Petrazzo, Lenard Lindstrom (handle functions)
Method Summary
  __init__(self, libraryName)
Init method for the class
  AdjustBrightness(self, bitmap, percentage)
Adjusts the brightness of a 8-, 24- or 32-bit image by a certain amount.
  AdjustContrast(self, bitmap, percentage)
Like up
  AdjustCurve(self, bitmap, LUT, channel)
Perfoms an histogram transformation on a 8-, 24- or 32-bit image according to the values of a lookup table (LUT).
  AdjustGamma(self, bitmap, gamma)
Performs gamma correction on a 8-, 24- or 32-bit image.
  Allocate(self, widht, height, bpp, redMask, greenMask, blueMask)
If you want to create a new bitmap in memory from scratch, without loading a pre-made bitmap from disc, you use this function.
  AllocateT(self, type, width, height, bpp, red_mask, green_mask, blue_mask)
  AppendPage(self, multiBitmap, data)
Append data page to the bitmap's end
  Clone(self, bitmap)
Makes an exact reproduction of an existing bitmap
  CloseMultiBitmap(self, multiBitmap, flags)
Flags is to enable or disable a feature into a plugin
  ColorQuantize(self, bitmap, quantize)
Quantizes a high-color 24-bit bitmap to an 8-bit palette color bitmap.
  ColorQuantizeEx(self, bitmap, quantize, PaletteSize, ReserveSize, ReservePalette)
FreeImage_ColorQuantizeEx is an extension to the FreeImage_ColorQuantize function that provides additional options
  ConvertFromRawBits(self, bits, width, height, pitch, bpp, red_mask, green_mask, blue_mask, topdown)
Converts a raw bitmap somewhere in memory to a FIBITMAP.
  convertPaletteToMinIsWhite(self, bitmap)
Convert only the bitmap palette to minswhite
  ConvertTo16Bits555(self, bitmap, close)
Convert the bitmap to 16/555 bits depth and optionally close it
  ConvertTo16Bits565(self, bitmap, close)
Convert the bitmap to 16/565 bits depth and optionally close it
  ConvertTo24Bits(self, bitmap, close)
  ConvertTo32Bits(self, bitmap, close)
Convert the bitmap to 64 bits depth and optionally close it
  ConvertTo4Bits(self, bitmap, close)
Convert the bitmap to 4 bits depth and optionally close it
  ConvertTo8Bits(self, bitmap, close)
Convert the bitmap to 8 bits depth and optionally close it
  convertToA4Fax(self, bitmap)
Convert the passed image to 1728 x 2210 pixel (206 x 196) DPI that is need when work with fax
  ConvertToGreyscale(self, bitmap, close)
Converts a bitmap to a 8-bit greyscale image with a linear ramp and optionally close it
  convertToMinIsWhite(self, bitmap)
Invert the bitmap colors and the palette from minIsBlack to minIsWhite
  convertToMultiPage(self, filesIn, fileOut, outFormat, outBpp, sameSize, sameType, keepSizeFrom, keepTypeFrom, flags, convertToFax, deleteOld)
Function for create the fileOut bitmap with fileIn list and optionally resize and convert the format of the bitmaps If you pass me format, I keep that like output format
  ConvertToRawBits(self, bits, bitmap, pitch, bpp, red_mask, green_mask, blue_mask, topdown)
Converts a FIBITMAP to a raw piece of memory.
  ConvertToRGBF(self, bitmap)
Converts a 24- or 32-bit RGB(A) standard image or a 48-bit RGB image to a FIT_RGBF type image.
  convertToSinglePages(self, multiPageName, outputFormat, outputExt, outputName, flags, bitmapType, returnOpenBitmap, outputDir, outputDepth)
Return the multiPage splitted into single pages The returned name are "outputNameXXX.outputExt" Where XXX is a progressive number, started from 0 If outputName isn't set, I create a new one name with tempfile
  ConvertToStandardType(self, bitmap, scale_linear, close)
Convert the passed image to a standard type
  ConvertToType(self, bitmap, dst_type, scale_linear)
Converts an image of any type to type dst_type.
  Copy(self, bitmap, left, top, right, bottom)
Copy a sub part of the current dib image.
  DeInitialise(self)
Deinitialises the library.
  DeletePage(self, multiBitmap, page)
Deletes the page on the given position.
  Dither(self, bitmap, matrix)
Transfom (out will be 1 bit per pixel) and return a copy of the bitmap
  FIFSupportsExportBPP(self, fif, bpp)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can save a bitmap in the desired bit depth
  FIFSupportsExportType(self, fif, type)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can save a bitmap in the desired data type,
  FIFSupportsICCProfiles(self, fif)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can load or save an ICC profile,
  FIFSupportsReading(self, fif)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to load bitmaps, FALSE otherwise.
  FIFSupportsWriting(self, fif)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to save bitmaps
  FindCloseMetadata(self, handle)
  FindFirstMetadata(self, model, dib, tag)
  FindNextMetadata(self, handle, tag)
  genericFileDeducer(self, fileName)
Check the file signature and deduce its format (the second argument is currently not used by FreeImage) return the type
  genericLoader(self, fileName, flag)
Check the file signature and deduce its format (the second argument is currently not used by FreeImage) return the bitmap loaded
  GetBackgroundColor(self, bitmap)
Retrieves the file background color of an image.
  GetBits(self, bitmap)
Returns a pointer to the data-bits of the bitmap.
  GetBlueMask(self, bitmap)
Returns a bit pattern describing the blue color component of a pixel in a FIBITMAP.
  GetBPP(self, bitmap)
Return the depth
  getBuffer(self, bitmap, close, topdown)
Return the bitmap's buffer
  GetChannel(self, bitmap, channel)
Retrieves the red, green, blue or alpha channel of a 24- or 32-bit image.
  GetColorsUsed(self, bitmap)
Return the number of color used
  GetColorType(self, bitmap)
Returm one of the FIC_* values
  GetComplexChannel(self, bitmap, channel)
Retrieves the real part, imaginary part, magnitude or phase of a complex image (image whose type is FIT_COMPLEX).
  GetCopyrightMessage(self)
Returns a string containing a standard copyright message you can show in your program.
  GetDIBSize(self, bitmap)
Returns the size of the DIB-element of a FIBITMAP in memory
  getDotDPI(self, bitmap)
Return the bitmap DPIs
  GetDotsPerMeterX(self, bitmap)
Return the horrizontal resolution
  GetDotsPerMeterY(self, bitmap)
Return the vertical resolution
  GetFIFCount(self)
Retrieves the number of FREE_IMAGE_FORMAT identifiers being currently registered.
  GetFIFDescription(self, fif)
Returns a descriptive string that describes the bitmap formats the given plugin can read and/or write.
  GetFIFExtensionList(self)
Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write.
  GetFIFFromFilename(self, fileName)
This function takes a filename or a file-extension and returns the plugin that can read/write files with that extension in the form of a FREE_IMAGE_FORMAT identifier.
  GetFIFFromFilenameU(self, fileName)
Same of GetfiFFromFilename.
  GetFIFFromFormat(self, format)
Returns a FREE_IMAGE_FORMAT identifier from the format string that was used to register the FIF.
  GetFIFFromMime(self, mime)
Returns a FREE_IMAGE_FORMAT identifier from a MIME content type string (MIME stands for Multipurpose Internet Mail Extension).
  GetFIFMimeType(self, fif)
Given a FREE_IMAGE_FORMAT identifier, returns a MIME content type string (MIME stands for Multipurpose Internet Mail Extension).
  GetFIFRegExpr(self, fif)
Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write.
  GetFileType(self, fileName, size)
Return the file type, like bmp, tiff, png This function return a value that are used in other functions that need the bitmap type Size it not used into the library
  GetFileTypeFromHandle(self, io_p, handle, flags)
Uses the FreeImageIO structure to identify a bitmap type
  GetFileTypeU(self, fileName, size)
Unicode version of GetFileType
  GetFormatFromFIF(self, fif)
Returns the string that was used to register a plugin from the system assigned FREE_IMAGE_FORMAT.
  GetGreenMask(self, bitmap)
Like up
  GetHeight(self, bitmap)
Return the bitmap height
  GetHistogram(self, bitmap, histo, channel)
Computes the image histogram.
  GetImageType(self, bitmap)
Return the image type
  GetInfo(self, bitmap)
Alias for GetInfoHeader
  GetInfoHeader(self, bitmap)
Returns a pointer to the BITMAPINFOHEADER of the DIB-element in a FIBITMAP.
  GetLibrary(self)
Return the current library isntance.
  GetLine(self, bitmap)
Returns the width of the bitmap in bytes.
  GetLockedPageNumbers(self, multiBitmap, pages, count)
Returns an array of page-numbers that are currently locked in memory.
  GetMetadata(self, mdModel, bitmap, key)
Return metadata
  GetMetadataCount(self, model, bitmap)
Returns the number of components in the tag
  GetPageCount(self, multiBitmap)
Return how many pages are present into this bitmap
  GetPalette(self, bitmap)
Return a pointer to a palette struct
  GetPitch(self, bitmap)
Returns the width of the bitmap in bytes, rounded to the next 32-bit boundary, also known as pitch or stride or scan width.
  GetPixelColor(self, bitmap, x, y, value)
Get the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access).
  GetPixelIndex(self, bitmap, x, y)
Return the pixel index for the bitmap, default return the first at left top
  GetRedMask(self, bitmap)
Like up
  GetScanLine(self, bitmap, scanline)
Returns a pointer to the start of the given scanline in the bitmap s data-bits.
  getSize(self, bitmap)
Help method.
  getStatus(self)
Return the library status
  GetTagCount(self, tag)
Returns the number of components in the tag (in tag type units).
  GetTagDescription(self, tag)
Returns the tag description if available, returns NULL otherwise.
  GetTagID(self, tag)
Returns the tag field name (unique inside a metadata model).
  GetTagKey(self, tag)
  GetTagType(self, tagId)
Return the datatype
  GetTagValue(self, tag)
Return the tag value
  getTagValue(self, bitmap, model, keyName)
Return the value of the key passed
  GetTransparencyCount(self, bitmap)
Returns the number of transparent colors in a palletised bitmap
  GetTransparencyTable(self, bitmap)
Returns a pointer to the bitmap s transparency table.
  GetVersion(self)
Returns a string containing the current version of the DLL.
  GetWidth(self, bitmap)
Return the bitmap width
  HasBackgroundColor(self, bitmap)
Returns TRUE when the image has a file background color
  Initialise(self, loadPlugin)
Initialises the library.
  InsertPage(self, multiBitmap, page, data)
Inserts a new page before the given position in the bitmap.
  Invert(self, bitmap)
Inverts each pixel data
  IsLittleEndian(self)
This function returns TRUE if the platform running FreeImage uses the Little Endian convention
  isMultiPage(self, fileName, fileType)
Return if the fileName passed is a multipage file the number of page is returned
  IsPluginEnabled(self, fif)
Returns TRUE when the plugin is enabled, FALSE when the plugin is disabled, -1 otherwise.
  IsTransparent(self, bitmap)
Returns TRUE when the transparency table is enabled
  Load(self, typ, fileName, flags)
This function decodes a bitmap, allocates memory for it and then returns it as a FIBITMAP.
  loadAndSave(self, fileNameLoad, dirNameSave, typeSave, fileLoadType)
Load the passed filename and save it with the type If dirNameSave is a directory, I create a new filename with tempfile, else I save the new bitmap with that file name For typeSave argoument, if you can pass me a value (string) present into extToType dictionary, I see the type, flags and extension from there, else, pass me a list/tuple with this three values
  loadFromBuffer(self, buffer, fif, flag)
Load an image from a buffer
  loadFromFile(self, f, fif, flag)
Load an image from an open python file object.
  LoadFromHandle(self, typ, io_p, handle, flags)
This function is the handle version of Load.
  LoadU(self, typ, fileName, flags)
Same of Load.
  LockPage(self, multiBitmap, page)
Lock and return a locked bitmap into a multipage bitmap
  MakeThumbnail(self, bitmap, max_pixel_size, convert, close)
  MovePage(self, multiBitmap, target, source)
Moves the source page to the position of the target page.
  openMulti(self, fileName, fileType)
Simple mthod for open multibitmap page
  OpenMultiBitmap(self, format, fileName, create, readOnly, keepInMemory, flags)
flags is to enable or disable a feature into a plugin
  Paste(self, bitmapTo, bitmap, left, top, alpha)
Alpha blend or combine a sub part image with the current dib image.
  RegisterExternalPlugin(self, path, format, description, extension, regexpr)
Registers a new plugin to be used in FreeImage.
  RegisterLocalPlugin(self, proc_address, format, description, extension, regexpr)
Registers a new plugin to be used in FreeImage.
  Rescale(self, bitmap, dstWidth, dstHeight, filter, close)
Return the bitmap rescaled with the parameter passed
  RotateClassic(self, bitmap, angle, close)
Rotate the bitmap and return a new bitmap
  RotateEx(self, bitmap, angle, x_shift, y_shift, x_origin, y_origin, use_mask)
This function performs a rotation and / or translation of an 8-bit greyscale, 24- or 32-bit image, using a 3rd order (cubic) B-Spline.
  Save(self, typ, bitmap, fileName, flags)
This function saves a previously loaded FIBITMAP to a file.
  saveToFile(self, fif, bitmap, f, flag)
Save an image from an open python file object.
  SaveToHandle(self, typ, bitmap, io, handle, flags)
This function saves a previously loadaed FIBITMAP to a file handle.
  SaveU(self, typ, bitmap, fileName, flags)
Same of Save.
  SetBackgroundColor(self, bitmap, color)
Set the file background color of an image.
  setBppFromBitmap(self, bitmapFrom, bitmapTo, close)
Change the bitmapTo depth to the bitmapFrom depth If closeTo if true, if close I return the new bitmap and the close the oldBitmap one
  setBppFromBpp(self, BppFrom, bitmapTo, close)
Change the bitmapTo depth to the bitmapFrom depth If closeTo if true, if close I return the new bitmap and the close the oldBitmap one
  SetChannel(self, bitmap, bitmap8, channel)
Insert a 8-bit dib into a 24- or 32-bit image.
  SetComplexChannel(self, bitmap, channel)
Set the real or imaginary part of a complex image (image whose type is FIT_COMPLEX).
  setDotDPI(self, bitmap, res)
Return the bitmap DPIs
  SetDotsPerMeterX(self, bitmap, res)
Set the horrizontal resolution
  SetDotsPerMeterY(self, bitmap, res)
Set the vertical resolution
  SetPixelColor(self, bitmap, x, y, value)
Set the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access).
  SetPixelIndex(self, bitmap, x, y, value)
Set the pixel index of a palettized image at position (x, y), including range check (slow access).
  SetPluginEnabled(self, fif, enabled)
Enables or disables a plugin.
  SetTransparencyTable(self, bitmap, table, count)
Set the bitmap s transparency table.
  SetTransparent(self, bitmap, enabled)
Tells FreeImage if it should make use of the transparency table that may accompany a bitmap
  TagToString(self, model, tag, make)
Converts a FreeImage tag structure to a string that represents the interpreted tag value.
  Threshold(self, bitmap, T)
Converts a bitmap to 1-bit monochrome bitmap using a threshold T between [0..255].
  Unload(self, bitmap)
Deletes a previously loaded FIBITMAP from memory.
  UnlockPage(self, multiBitmap, bitmap, modified)
UnLock a page into a multipage bitmap if modified, the engine update the bitmap with that passed
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  library
  version

Method Details

__init__(self, libraryName=None)
(Constructor)

Init method for the class
Parameters:
libraryName - library path, otherwise I'll look for it into the standard path
           (type=string)
Overrides:
__builtin__.object.__init__

AdjustBrightness(self, bitmap, percentage)

Adjusts the brightness of a 8-, 24- or 32-bit image by a certain amount.

AdjustContrast(self, bitmap, percentage)

Like up

AdjustCurve(self, bitmap, LUT, channel)

Perfoms an histogram transformation on a 8-, 24- or 32-bit image according to the values of a lookup table (LUT).

AdjustGamma(self, bitmap, gamma)

Performs gamma correction on a 8-, 24- or 32-bit image.

Allocate(self, widht, height, bpp, redMask=False, greenMask=False, blueMask=False)

If you want to create a new bitmap in memory from scratch, without loading a pre-made bitmap from disc, you use this function.

AppendPage(self, multiBitmap, data)

Append data page to the bitmap's end
Parameters:
multiBitmap - the multibitmap image
data - the bitmap already loaded to append

Clone(self, bitmap)

Makes an exact reproduction of an existing bitmap

CloseMultiBitmap(self, multiBitmap, flags=False)

Flags is to enable or disable a feature into a plugin

ColorQuantize(self, bitmap, quantize=0)

Quantizes a high-color 24-bit bitmap to an 8-bit palette color bitmap. The quantize parameter specifies the color reduction algorithm to be used:

ColorQuantizeEx(self, bitmap, quantize=0, PaletteSize=256, ReserveSize=0, ReservePalette=None)

FreeImage_ColorQuantizeEx is an extension to the FreeImage_ColorQuantize function that provides additional options

ConvertFromRawBits(self, bits, width, height, pitch, bpp, red_mask, green_mask, blue_mask, topdown=False)

Converts a raw bitmap somewhere in memory to a FIBITMAP.

convertPaletteToMinIsWhite(self, bitmap)

Convert only the bitmap palette to minswhite

ConvertTo16Bits555(self, bitmap, close=0)

Convert the bitmap to 16/555 bits depth and optionally close it

ConvertTo16Bits565(self, bitmap, close=0)

Convert the bitmap to 16/565 bits depth and optionally close it

ConvertTo32Bits(self, bitmap, close=0)

Convert the bitmap to 64 bits depth and optionally close it

ConvertTo4Bits(self, bitmap, close=0)

Convert the bitmap to 4 bits depth and optionally close it

ConvertTo8Bits(self, bitmap, close=0)

Convert the bitmap to 8 bits depth and optionally close it

convertToA4Fax(self, bitmap)

Convert the passed image to 1728 x 2210 pixel (206 x 196) DPI that is need when work with fax

ConvertToGreyscale(self, bitmap, close=0)

Converts a bitmap to a 8-bit greyscale image with a linear ramp and optionally close it

convertToMinIsWhite(self, bitmap)

Invert the bitmap colors and the palette from minIsBlack to minIsWhite

convertToMultiPage(self, filesIn, fileOut, outFormat=-1, outBpp=-1, sameSize=False, sameType=False, keepSizeFrom=0, keepTypeFrom=0, flags=False, convertToFax=0, deleteOld=0)

Function for create the fileOut bitmap with fileIn list and optionally resize and convert the format of the bitmaps If you pass me format, I keep that like output format

filesIn can be a list or tuple with (fileName, type) or only the filesNames, so I *try* to get the type

deleteOld is used to tell me to delete the old files

ConvertToRawBits(self, bits, bitmap, pitch, bpp, red_mask, green_mask, blue_mask, topdown=False)

Converts a FIBITMAP to a raw piece of memory.

ConvertToRGBF(self, bitmap)

Converts a 24- or 32-bit RGB(A) standard image or a 48-bit RGB image to a FIT_RGBF type image.

convertToSinglePages(self, multiPageName, outputFormat, outputExt, outputName=None, flags=None, bitmapType=-1, returnOpenBitmap=0, outputDir=None, outputDepth=-1)

Return the multiPage splitted into single pages The returned name are "outputNameXXX.outputExt" Where XXX is a progressive number, started from 0 If outputName isn't set, I create a new one name with tempfile

If returnOpenBitmap is set, I return the opened bitmaps, loaded into FITBITMAP structures

ConvertToStandardType(self, bitmap, scale_linear=1, close=0)

Convert the passed image to a standard type

ConvertToType(self, bitmap, dst_type, scale_linear=True)

Converts an image of any type to type dst_type.

Copy(self, bitmap, left, top, right, bottom)

Copy a sub part of the current dib image.

DeInitialise(self)

Deinitialises the library.

DeletePage(self, multiBitmap, page)

Deletes the page on the given position.
Parameters:
multiBitmap - the multibitmap image
page - the page to delete
           (type=int)

Dither(self, bitmap, matrix=0)

Transfom (out will be 1 bit per pixel) and return a copy of the bitmap

FIFSupportsExportBPP(self, fif, bpp)

Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can save a bitmap in the desired bit depth

FIFSupportsExportType(self, fif, type)

Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can save a bitmap in the desired data type,

FIFSupportsICCProfiles(self, fif)

Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can load or save an ICC profile,

FIFSupportsReading(self, fif)

Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to load bitmaps, FALSE otherwise.

FIFSupportsWriting(self, fif)

Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to save bitmaps

genericFileDeducer(self, fileName)

Check the file signature and deduce its format (the second argument is currently not used by FreeImage) return the type

--- Thanks to the C++ code found on FreeImage examples

genericLoader(self, fileName, flag=0)

Check the file signature and deduce its format (the second argument is currently not used by FreeImage) return the bitmap loaded

--- Thanks to the C++ code found on FreeImage examples

GetBackgroundColor(self, bitmap)

Retrieves the file background color of an image.

GetBits(self, bitmap)

Returns a pointer to the data-bits of the bitmap.
Parameters:
bitmap - bitmap
           (type=int)

GetBlueMask(self, bitmap)

Returns a bit pattern describing the blue color component of a pixel in a FIBITMAP.

GetBPP(self, bitmap)

Return the depth

getBuffer(self, bitmap, close=0, topdown=False)

Return the bitmap's buffer
Parameters:
bitmap - bitmap
           (type=int)
close - if true, I'll close the bitmap
           (type=int)
topdown - store the bitmap top-left pixel first when it is True or bottom-left pixel first when it is False.
           (type=int)

GetChannel(self, bitmap, channel)

Retrieves the red, green, blue or alpha channel of a 24- or 32-bit image.

GetColorsUsed(self, bitmap)

Return the number of color used

GetColorType(self, bitmap)

Returm one of the FIC_* values

GetComplexChannel(self, bitmap, channel)

Retrieves the real part, imaginary part, magnitude or phase of a complex image (image whose type is FIT_COMPLEX).

GetCopyrightMessage(self)

Returns a string containing a standard copyright message you can show in your program.

GetDIBSize(self, bitmap)

Returns the size of the DIB-element of a FIBITMAP in memory

getDotDPI(self, bitmap)

Return the bitmap DPIs

GetDotsPerMeterX(self, bitmap)

Return the horrizontal resolution

GetDotsPerMeterY(self, bitmap)

Return the vertical resolution

GetFIFCount(self)

Retrieves the number of FREE_IMAGE_FORMAT identifiers being currently registered.

GetFIFDescription(self, fif)

Returns a descriptive string that describes the bitmap formats the given plugin can read and/or write.

GetFIFExtensionList(self)

Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write.

GetFIFFromFilename(self, fileName)

This function takes a filename or a file-extension and returns the plugin that can read/write files with that extension in the form of a FREE_IMAGE_FORMAT identifier.

GetFIFFromFilenameU(self, fileName)

Same of GetfiFFromFilename. UNICODE version. Work only on win32 systems

See Also: GetfiFFromFilename

GetFIFFromFormat(self, format)

Returns a FREE_IMAGE_FORMAT identifier from the format string that was used to register the FIF.

GetFIFFromMime(self, mime)

Returns a FREE_IMAGE_FORMAT identifier from a MIME content type string (MIME stands for Multipurpose Internet Mail Extension).

GetFIFMimeType(self, fif)

Given a FREE_IMAGE_FORMAT identifier, returns a MIME content type string (MIME stands for Multipurpose Internet Mail Extension).

GetFIFRegExpr(self, fif)

Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write.

GetFileType(self, fileName, size=False)

Return the file type, like bmp, tiff, png This function return a value that are used in other functions that need the bitmap type Size it not used into the library

GetFileTypeFromHandle(self, io_p, handle, flags=False)

Uses the FreeImageIO structure to identify a bitmap type

GetFileTypeU(self, fileName, size=False)

Unicode version of GetFileType

See Also: GetFileType

GetFormatFromFIF(self, fif)

Returns the string that was used to register a plugin from the system assigned FREE_IMAGE_FORMAT.

GetGreenMask(self, bitmap)

Like up

GetHeight(self, bitmap)

Return the bitmap height

GetHistogram(self, bitmap, histo, channel)

Computes the image histogram.

GetImageType(self, bitmap)

Return the image type

GetInfo(self, bitmap)

Alias for GetInfoHeader

GetInfoHeader(self, bitmap)

Returns a pointer to the BITMAPINFOHEADER of the DIB-element in a FIBITMAP.

GetLibrary(self)

Return the current library isntance. Use with careful

GetLine(self, bitmap)

Returns the width of the bitmap in bytes. See also: FreeImage_GetPitch.

GetLockedPageNumbers(self, multiBitmap, pages=None, count=None)

Returns an array of page-numbers that are currently locked in memory.

GetMetadata(self, mdModel, bitmap, key)

Return metadata

GetMetadataCount(self, model, bitmap)

Returns the number of components in the tag

GetPageCount(self, multiBitmap)

Return how many pages are present into this bitmap

GetPalette(self, bitmap)

Return a pointer to a palette struct

GetPitch(self, bitmap)

Returns the width of the bitmap in bytes, rounded to the next 32-bit boundary, also known as pitch or stride or scan width.

Bug: If bitmap bpp aren't 24 or 32, this function may not return the right value.

GetPixelColor(self, bitmap, x, y, value=None)

Get the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access).

GetPixelIndex(self, bitmap, x=0, y=0)

Return the pixel index for the bitmap, default return the first at left top

GetRedMask(self, bitmap)

Like up

GetScanLine(self, bitmap, scanline)

Returns a pointer to the start of the given scanline in the bitmap s data-bits.

getSize(self, bitmap)

Help method. Return a tuple with (widht, height)

getStatus(self)

Return the library status

GetTagCount(self, tag)

Returns the number of components in the tag (in tag type units).

GetTagDescription(self, tag)

Returns the tag description if available, returns NULL otherwise.

GetTagID(self, tag)

Returns the tag field name (unique inside a metadata model).

GetTagType(self, tagId)

Return the datatype

GetTagValue(self, tag)

Return the tag value

getTagValue(self, bitmap, model, keyName)

Return the value of the key passed
Parameters:
bitmap - A loaded bitmap
           (type=int (void))
model - Model code
           (type=FREE_IMAGE_MDMODEL (int))
keyName - The key name
           (type=string)

GetTransparencyCount(self, bitmap)

Returns the number of transparent colors in a palletised bitmap

GetTransparencyTable(self, bitmap)

Returns a pointer to the bitmap s transparency table.

GetVersion(self)

Returns a string containing the current version of the DLL.

GetWidth(self, bitmap)

Return the bitmap width

HasBackgroundColor(self, bitmap)

Returns TRUE when the image has a file background color

Initialise(self, loadPlugin=False)

Initialises the library. When the loadPlugin parameter is TRUE, FreeImage won t make use of external plugins.

InsertPage(self, multiBitmap, page, data)

Inserts a new page before the given position in the bitmap.
Parameters:
multiBitmap - the multibitmap image
page - the page to delete
           (type=int)
data - the bitmap already loaded

Invert(self, bitmap)

Inverts each pixel data

IsLittleEndian(self)

This function returns TRUE if the platform running FreeImage uses the Little Endian convention

isMultiPage(self, fileName, fileType=False)

Return if the fileName passed is a multipage file the number of page is returned

IsPluginEnabled(self, fif)

Returns TRUE when the plugin is enabled, FALSE when the plugin is disabled, -1 otherwise.

IsTransparent(self, bitmap)

Returns TRUE when the transparency table is enabled

Load(self, typ, fileName, flags=False)

This function decodes a bitmap, allocates memory for it and then returns it as a FIBITMAP.

loadAndSave(self, fileNameLoad, dirNameSave, typeSave, fileLoadType=None)

Load the passed filename and save it with the type If dirNameSave is a directory, I create a new filename with tempfile, else I save the new bitmap with that file name For typeSave argoument, if you can pass me a value (string) present into extToType dictionary, I see the type, flags and extension from there, else, pass me a list/tuple with this three values

loadFromBuffer(self, buffer, fif=None, flag=0)

Load an image from a buffer

loadFromFile(self, f, fif=None, flag=0)

Load an image from an open python file object.

LoadFromHandle(self, typ, io_p, handle, flags=False)

This function is the handle version of Load.

LoadU(self, typ, fileName, flags=False)

Same of Load. UNICODE version. Work only on win32 systems

See Also: Load

LockPage(self, multiBitmap, page)

Lock and return a locked bitmap into a multipage bitmap
Parameters:
multiBitmap - the multibitmap image
page - the page to lock
           (type=int)

MovePage(self, multiBitmap, target, source)

Moves the source page to the position of the target page. Returns TRUE on success, FALSE on failure.
Parameters:
target
           (type=int)
source
           (type=int)

openMulti(self, fileName, fileType=None)

Simple mthod for open multibitmap page

OpenMultiBitmap(self, format, fileName, create=False, readOnly=False, keepInMemory=True, flags=False)

flags is to enable or disable a feature into a plugin

Paste(self, bitmapTo, bitmap, left, top, alpha)

Alpha blend or combine a sub part image with the current dib image. alpha : alpha blend factor. The source and destination images are alpha blended if alpha=0..255. If alpha > 255, then the source image is combined to the destination image.

RegisterExternalPlugin(self, path, format=0, description=0, extension=0, regexpr=0)

Registers a new plugin to be used in FreeImage.

RegisterLocalPlugin(self, proc_address, format=0, description=0, extension=0, regexpr=0)

Registers a new plugin to be used in FreeImage.

Rescale(self, bitmap, dstWidth, dstHeight, filter=3, close=0)

Return the bitmap rescaled with the parameter passed

RotateClassic(self, bitmap, angle, close=0)

Rotate the bitmap and return a new bitmap

RotateEx(self, bitmap, angle, x_shift, y_shift, x_origin, y_origin, use_mask)

This function performs a rotation and / or translation of an 8-bit greyscale, 24- or 32-bit image, using a 3rd order (cubic) B-Spline.

Save(self, typ, bitmap, fileName, flags=False)

This function saves a previously loaded FIBITMAP to a file.

saveToFile(self, fif, bitmap, f, flag=0)

Save an image from an open python file object.

SaveToHandle(self, typ, bitmap, io, handle, flags=False)

This function saves a previously loadaed FIBITMAP to a file handle.

SaveU(self, typ, bitmap, fileName, flags=False)

Same of Save. UNICODE version. Work only on win32 systems.

See Also: Save

SetBackgroundColor(self, bitmap, color)

Set the file background color of an image.

setBppFromBitmap(self, bitmapFrom, bitmapTo, close=1)

Change the bitmapTo depth to the bitmapFrom depth If closeTo if true, if close I return the new bitmap and the close the oldBitmap one

setBppFromBpp(self, BppFrom, bitmapTo, close=1)

Change the bitmapTo depth to the bitmapFrom depth If closeTo if true, if close I return the new bitmap and the close the oldBitmap one

SetChannel(self, bitmap, bitmap8, channel)

Insert a 8-bit dib into a 24- or 32-bit image. dib8 and dib must have the same width and height.

SetComplexChannel(self, bitmap, channel)

Set the real or imaginary part of a complex image (image whose type is FIT_COMPLEX).

setDotDPI(self, bitmap, res)

Return the bitmap DPIs

SetDotsPerMeterX(self, bitmap, res)

Set the horrizontal resolution

SetDotsPerMeterY(self, bitmap, res)

Set the vertical resolution

SetPixelColor(self, bitmap, x, y, value=None)

Set the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access).

SetPixelIndex(self, bitmap, x, y, value=None)

Set the pixel index of a palettized image at position (x, y), including range check (slow access).

SetPluginEnabled(self, fif, enabled)

Enables or disables a plugin.

SetTransparencyTable(self, bitmap, table, count)

Set the bitmap s transparency table.

SetTransparent(self, bitmap, enabled)

Tells FreeImage if it should make use of the transparency table that may accompany a bitmap

TagToString(self, model, tag, make=None)

Converts a FreeImage tag structure to a string that represents the interpreted tag value.

Threshold(self, bitmap, T)

Converts a bitmap to 1-bit monochrome bitmap using a threshold T between [0..255].

Unload(self, bitmap)

Deletes a previously loaded FIBITMAP from memory. You always need to call this function once you are done with a bitmap, or you will have a memory leak

UnlockPage(self, multiBitmap, bitmap, modified=False)

UnLock a page into a multipage bitmap if modified, the engine update the bitmap with that passed
Parameters:
multiBitmap - the multibitmap image
bitmap - the bitmap to unlock

Property Details

library

Get Method:
GetLibrary(self)

version

Get Method:
GetVersion(self)

Generated by Epydoc 2.1 on Fri Nov 17 12:52:34 2006 http://epydoc.sf.net