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

Type Image

object --+    
         |    
 freeimage --+
             |
            Image


FreeImagePy Image class. Use me like I'm a PIL Image class.

Here you not need to pass me every time the dib istance, because 
it'll remember the dib alone:

freeimage class (old method):
    import FreeImagePy as FIPY
    F = FIPY.freeimage()
    dib = F.genericLoader("mypath.png")
    newD = F.RotateClassic(dib, 90)
    F.save(FIF_TIFFG4, "new_path.png", newD)
    F.Unload(dib)
    F.Unload(newD)

Image class (new):
    import FreeImagePy as FIPY
    F = FIPY.Image("mypath.png")
    newI = F.rotate(90)
    newI.save("mypath.tiffg4") # save a mypath.tiff with g4 compression
    del I, newI
    
@author: Michele Petrazzo

Method Summary
  __init__(self, f, libraryName)
Costrunct class
  __del__(self)
Implicit unload the bitmap
  __iter__(self)
Iterate over a multipage dib
  __repr__(self)
  appendPage(self, fileName, bitmap, insert)
Append new page from an already loaded bitmap or from a filename.
  clone(self)
Clone the current bitmap
  close(self)
Close the loaded bitmap
  convertToMinIsWhite(self, invert)
Convert the current bitmap to MINISWHITE.
  convertToPages(self, fileOut, extType)
Convert the multipage dib loaded into single pages
  convertToPil(self)
Convert the current Image to PIL image, if PIL is installed
  convertToWx(self)
Covnert the current Image to PIL image, if PIL is installed
  copy(self, left, top, right, bottom, unloadPrev)
Copy a sub part of the current dib image, return a new Image
  deletePage(self, pageNum)
Delete the page passed as value
  exit(self)
Close the bitmap and unload the library
  fromBuffer(self, buff, fif, flag, unloadPrev)
Load a buffer and (try) to convert it to a dib.
  GetBackgroundColor(self)
Return the background color, if any.
  getBitmap(self)
Return the current bitmap dib
  getBPP(self)
Get the bpp (size of one pixel in the bitmap in bits)
  getBuffer(self, close, topdown)
Retrun the bitmap buffer
  getColorUsed(self)
Return the color used @return int
  getCurrentPage(self)
Return the current page number
  getFileName(self)
Return the bitmap filename path (when load)
  getFormat(self)
Return the bitmap format
  GetHistogram(self)
Return image histogram
  getMetadata(self)
Return the matadata data this image has inside
  GetMetadataCount(self)
Count metadata for this model
  getNumPages(self)
Return the current bitmap page numbers
  getPixel(self, point)
Return the pixel value
  getSize(self)
Return the bitmap size
  getStatus(self)
Return the library status
  GetTransparent(self)
  getUnloadWhenDel(self)
Return if I have to delete the bitmap when close
  invert(self)
Invert the bitmap colors in place
  isMulti(self)
Return if the bitmap loaded is a multipage dib
  load(self, fileName, unloadPrev, try_multiPage)
Load the filename
  loadFromBitmap(self, bitmap, unloadPrev)
Load an already loaded bitmap.
  new(self, size, bpp, white, unloadPrev, multiBitmap, fileType, flags)
Create a new image with the given FISize and with that BPP
  next(self)
  ok(self)
Return if the bitmap and its associated library istance status
  paste(self, bitmap, box, alpha)
Paste an image passed into this image
  resize(self, size, filter, inplace)
Set the image size.
  rotate(self, angle, inplace)
Rotate the bitmap and return the new one if inplace are False
  save(self, fileName, type, flags)
Save the current already loaded bitmap
  seek(self, page)
Seek method.
  SetBackgroundColor(self, color)
Set background color.
  setBitmap(self, bitmap)
Set the current bitmap dib
  setBPP(self, bpp)
Set the bpp value
  setColorUsed(self, bpp)
Change the depth color for this bitmap
  setCurrentPage(self, pageNum)
Set the current page number.
  setSize(self, size, filter, inplace)
Property size method
  SetTransparent(self, value)
  setUnloadWhenDel(self, value)
Set the unloadWhenDel attribute
  tell(self)
Tell method
  thumbnail(self, max_pixel_size, convert, close)
Make an image thumbnail and return a new image Pay attention to set close arg 0!
    Inherited from freeimage
  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
  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
  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
  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
  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
  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.
  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.
  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.
  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
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  backgroundColor
  bitmap
  bpp
  currentPage
  filename
  format
  histogram
  metadata
  numPages
  size
  status
  transparent
  unloadWhenDel
    Inherited from freeimage
  library
  version

Method Details

__init__(self, f=None, libraryName=None)
(Constructor)

Costrunct class
Overrides:
FreeImagePy.FreeImagePy.freeimage.__init__

See Also: freeimage __init__

__del__(self)
(Destructor)

Implicit unload the bitmap

__iter__(self)

Iterate over a multipage dib

appendPage(self, fileName=None, bitmap=None, insert=None)

Append new page from an already loaded bitmap or from a filename. If insert is an int, insert the image into that position
Parameters:
fileName - filename path or None
bitmap - an Image istance or an "old" bitmap or None
insert
           (type=int or None. If int I'll insert the bitmap at insert number)

clone(self)

Clone the current bitmap
Returns:
new Image istance

close(self)

Close the loaded bitmap

convertToMinIsWhite(self, invert=True)

Convert the current bitmap to MINISWHITE.
Parameters:
invert - If False, I only invert the palette
           (type=True/False)
Overrides:
FreeImagePy.FreeImagePy.freeimage.convertToMinIsWhite

convertToPages(self, fileOut, extType=None)

Convert the multipage dib loaded into single pages
Parameters:
fileOut - the output filename.
           (type=string)
extType - strings indicate the extension or int the type (FIF_*)
           (type=str or int)

convertToPil(self)

Convert the current Image to PIL image, if PIL is installed
Returns:
PIL istance or None if PIL is not installed

convertToWx(self)

Covnert the current Image to PIL image, if PIL is installed
Returns:
PIL istance or None if PIL is not installed

copy(self, left, top, right, bottom, unloadPrev=False)

Copy a sub part of the current dib image, return a new Image
Parameters:
left, top, right, bottom - The image rectangle to copy
           (type of left=int)
           (type of top=int)
           (type of right=int)
           (type of bottom=int)
Returns:
New bitmap istance

deletePage(self, pageNum)

Delete the page passed as value
Parameters:
pageNum - Page number
           (type=int)

exit(self)

Close the bitmap and unload the library

fromBuffer(self, buff, fif=None, flag=0, unloadPrev=True)

Load a buffer and (try) to convert it to a dib.
Parameters:
buff - The buffer
           (type=string)

GetBackgroundColor(self)

Return the background color, if any. Otherwise I'll return 0
Returns:
0 (if no bg color) or (R,G,B)
Overrides:
FreeImagePy.FreeImagePy.freeimage.GetBackgroundColor

getBitmap(self)

Return the current bitmap dib
Returns:
int

getBPP(self)

Get the bpp (size of one pixel in the bitmap in bits)
Returns:
int

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

Retrun the bitmap buffer
Returns:
buffer
Overrides:
FreeImagePy.FreeImagePy.freeimage.getBuffer

getColorUsed(self)

Return the color used @return int

getCurrentPage(self)

Return the current page number
Returns:
int

getFileName(self)

Return the bitmap filename path (when load)
Returns:
string file name

getFormat(self)

Return the bitmap format
Returns:
(FIF type, FIC type) -> Example: (TIFF, RGB)

GetHistogram(self)

Return image histogram
Overrides:
FreeImagePy.FreeImagePy.freeimage.GetHistogram

getMetadata(self)

Return the matadata data this image has inside

GetMetadataCount(self)

Count metadata for this model
Overrides:
FreeImagePy.FreeImagePy.freeimage.GetMetadataCount

getNumPages(self)

Return the current bitmap page numbers
Returns:
int

getPixel(self, point)

Return the pixel value
Parameters:
point - The points for find the pixel value
           (type=FIPoint or tuple (x,y))

getSize(self)

Return the bitmap size
Returns:
FISize (w,h)
Overrides:
FreeImagePy.FreeImagePy.freeimage.getSize

getStatus(self)

Return the library status
Overrides:
FreeImagePy.FreeImagePy.freeimage.getStatus

getUnloadWhenDel(self)

Return if I have to delete the bitmap when close

invert(self)

Invert the bitmap colors in place

isMulti(self)

Return if the bitmap loaded is a multipage dib
Returns:
int

load(self, fileName, unloadPrev=True, try_multiPage=True)

Load the filename
Parameters:
fileName - File name path
           (type=string)

loadFromBitmap(self, bitmap, unloadPrev=True)

Load an already loaded bitmap. Useful when you have to use some functions that this class hasn't bind.
Parameters:
bitmap - An already loaded bitmap (Useful for the old class style)
           (type=int)
unloadPrev - Uload the previous bitmap if there is one
           (type=True/False)

new(self, size=None, bpp=24, white=True, unloadPrev=True, multiBitmap=None, fileType=None, flags=0)

Create a new image with the given FISize and with that BPP
Parameters:
size - The new bitmap size. Can be none if the bitmap are a multipage
           (type=FISize (w,h) or two value tuple)
bpp - color depth
           (type=in (1 -> 32))
white - If True, I return a white image
           (type=True/False)
multiBitmap - multiBitmap path for the new image
           (type=string)
fileType - FIF_*

ok(self)

Return if the bitmap and its associated library istance status
Returns:
string

paste(self, bitmap, box=None, alpha=255)

Paste an image passed into this image
Parameters:
bitmap - The bitmap where copy
box - The box size
           (type=- None -> start to paste at (0,0)
  • FIPoint (left, top) -> start to past at (left, top)
  • Four values tuple (left, top, right, bottom) paste AND resize if need the source bitmap. I clone the image before resize it
)
alpha -
           (type=)

resize(self, size, filter=3, inplace=True)

Set the image size. If inplace is True I'll resize the current bitmap If not inplace, pay attention to keep the bitmap istance and delete it when no longer used.
Parameters:
size - new bitmap size
           (type=FISize or a tuple (w,h))
filter - filter type, see FILTER_*
           (type=int)
inplace - Resize inplace or not the bitmap
           (type=True o False)

rotate(self, angle, inplace=False)

Rotate the bitmap and return the new one if inplace are False
Parameters:
angle - The angle to rotate
           (type=int)
inplace - Rotate the image inplace
           (type=int)

save(self, fileName, type=None, flags=False)

Save the current already loaded bitmap
Parameters:
fileName - File name path. If fileName has extension, and not type are specified, try to learn the type from extension
           (type=string)
type - a extToType key or a FIF type
           (type=int/string)
flags - some -type specific- flags
           (type=int)

seek(self, page=0)

Seek method.

See Also: setCurrentPage

SetBackgroundColor(self, color)

Set background color.
Parameters:
color
           (type=dict)
Overrides:
FreeImagePy.FreeImagePy.freeimage.SetBackgroundColor

setBitmap(self, bitmap)

Set the current bitmap dib
Parameters:
bitmap - An Image istance or an "old" bitmap dib
           (type=Image istance or int)

setBPP(self, bpp)

Set the bpp value
Parameters:
bpp - The new bpp value
           (type=int)

setColorUsed(self, bpp)

Change the depth color for this bitmap
Parameters:
bpp - New depth
           (type=int (1,4,8,16,32))

setCurrentPage(self, pageNum=0)

Set the current page number. If yor seek outside the image sequens, raise EOFError
Parameters:
pageNum - The page to laod into a multi-page environ
           (type=Int)

setSize(self, size, filter=3, inplace=True)

Property size method
Parameters:
size - new bitmap size
           (type=FISize or a tuple (w,h))

setUnloadWhenDel(self, value)

Set the unloadWhenDel attribute
Parameters:
value - The value
           (type=True or False)

tell(self)

Tell method

See Also: getCurrentPage

thumbnail(self, max_pixel_size, convert=True, close=0)

Make an image thumbnail and return a new image Pay attention to set close arg 0!

Property Details

backgroundColor

Get Method:
GetBackgroundColor(self)
Set Method:
SetBackgroundColor(self, color)

bitmap

Get Method:
getBitmap(self)
Set Method:
setBitmap(self, bitmap)

bpp

Get Method:
getBPP(self)
Set Method:
setBPP(self, bpp)

currentPage

Get Method:
getCurrentPage(self)
Set Method:
setCurrentPage(self, pageNum)

filename

Get Method:
getFileName(self)

format

Get Method:
getFormat(self)

histogram

Get Method:
GetHistogram(self)

metadata

Get Method:
getMetadata(self)

numPages

Get Method:
getNumPages(self)

size

Get Method:
getSize(self)
Set Method:
setSize(self, size, filter, inplace)

status

Get Method:
getStatus(self)

transparent

Get Method:
GetTransparent(self)
Set Method:
SetTransparent(self, value)

unloadWhenDel

Get Method:
getUnloadWhenDel(self)
Set Method:
setUnloadWhenDel(self, value)

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