| Trees | Index | Help |
|
|---|
| Package FreeImagePy :: Module FreeImagePy :: Class 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 | |
|---|---|
Costrunct class | |
Implicit unload the bitmap | |
Iterate over a multipage dib | |
__repr__(self)
| |
Append new page from an already loaded bitmap or from a filename. | |
Clone the current bitmap | |
Close the loaded bitmap | |
Convert the current bitmap to MINISWHITE. | |
Convert the multipage dib loaded into single pages | |
Convert the current Image to PIL image, if PIL is installed | |
Covnert the current Image to PIL image, if PIL is installed | |
Copy a sub part of the current dib image, return a new Image | |
Delete the page passed as value | |
Close the bitmap and unload the library | |
Load a buffer and (try) to convert it to a dib. | |
Return the background color, if any. | |
Return the current bitmap dib | |
Get the bpp (size of one pixel in the bitmap in bits) | |
Retrun the bitmap buffer | |
Return the color used @return int | |
Return the current page number | |
Return the bitmap filename path (when load) | |
Return the bitmap format | |
Return image histogram | |
Return the matadata data this image has inside | |
Count metadata for this model | |
Return the current bitmap page numbers | |
Return the pixel value | |
Return the bitmap size | |
Return the library status | |
GetTransparent(self)
| |
Return if I have to delete the bitmap when close | |
Invert the bitmap colors in place | |
Return if the bitmap loaded is a multipage dib | |
Load the filename | |
Load an already loaded bitmap. | |
Create a new image with the given FISize and with that BPP | |
next(self)
| |
Return if the bitmap and its associated library istance status | |
Paste an image passed into this image | |
Set the image size. | |
Rotate the bitmap and return the new one if inplace are False | |
Save the current already loaded bitmap | |
Seek method. | |
Set background color. | |
Set the current bitmap dib | |
Set the bpp value | |
Change the depth color for this bitmap | |
Set the current page number. | |
Property size method | |
SetTransparent(self,
value)
| |
Set the unloadWhenDel attribute | |
Tell method | |
Make an image thumbnail and return a new image Pay attention to set close arg 0! | |
| Inherited from freeimage | |
Adjusts the brightness of a 8-, 24- or 32-bit image by a certain amount. | |
Like up | |
Perfoms an histogram transformation on a 8-, 24- or 32-bit image according to the values of a lookup table (LUT). | |
Performs gamma correction on a 8-, 24- or 32-bit image. | |
If you want to create a new bitmap in memory from scratch, without loading a pre-made bitmap from disc, you use this function. | |
| |
Append data page to the bitmap's end | |
Makes an exact reproduction of an existing bitmap | |
Flags is to enable or disable a feature into a plugin | |
Quantizes a high-color 24-bit bitmap to an 8-bit palette color bitmap. | |
FreeImage_ColorQuantizeEx is an extension to the FreeImage_ColorQuantize function that provides additional options | |
Converts a raw bitmap somewhere in memory to a FIBITMAP. | |
Convert only the bitmap palette to minswhite | |
Convert the bitmap to 16/555 bits depth and optionally close it | |
Convert the bitmap to 16/565 bits depth and optionally close it | |
| |
Convert the bitmap to 64 bits depth and optionally close it | |
Convert the bitmap to 4 bits depth and optionally close it | |
Convert the bitmap to 8 bits depth and optionally close it | |
Convert the passed image to 1728 x 2210 pixel (206 x 196) DPI that is need when work with fax | |
Converts a bitmap to a 8-bit greyscale image with a linear ramp and optionally close it | |
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 | |
Converts a FIBITMAP to a raw piece of memory. | |
Converts a 24- or 32-bit RGB(A) standard image or a 48-bit RGB image to a FIT_RGBF type image. | |
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 | |
Convert the passed image to a standard type | |
Converts an image of any type to type dst_type. | |
Copy a sub part of the current dib image. | |
Deinitialises the library. | |
Deletes the page on the given position. | |
Transfom (out will be 1 bit per pixel) and return a copy of the bitmap | |
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can save a bitmap in the desired bit depth | |
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can save a bitmap in the desired data type, | |
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can load or save an ICC profile, | |
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to load bitmaps, FALSE otherwise. | |
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to save bitmaps | |
| |
| |
| |
Check the file signature and deduce its format (the second argument is currently not used by FreeImage) return the type | |
Check the file signature and deduce its format (the second argument is currently not used by FreeImage) return the bitmap loaded | |
Returns a pointer to the data-bits of the bitmap. | |
Returns a bit pattern describing the blue color component of a pixel in a FIBITMAP. | |
Return the depth | |
Retrieves the red, green, blue or alpha channel of a 24- or 32-bit image. | |
Return the number of color used | |
Returm one of the FIC_* values | |
Retrieves the real part, imaginary part, magnitude or phase of a complex image (image whose type is FIT_COMPLEX). | |
Returns a string containing a standard copyright message you can show in your program. | |
Returns the size of the DIB-element of a FIBITMAP in memory | |
Return the bitmap DPIs | |
Return the horrizontal resolution | |
Return the vertical resolution | |
Retrieves the number of FREE_IMAGE_FORMAT identifiers being currently registered. | |
Returns a descriptive string that describes the bitmap formats the given plugin can read and/or write. | |
Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write. | |
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. | |
Same of GetfiFFromFilename. | |
Returns a FREE_IMAGE_FORMAT identifier from the format string that was used to register the FIF. | |
Returns a FREE_IMAGE_FORMAT identifier from a MIME content type string (MIME stands for Multipurpose Internet Mail Extension). | |
Given a FREE_IMAGE_FORMAT identifier, returns a MIME content type string (MIME stands for Multipurpose Internet Mail Extension). | |
Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write. | |
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 | |
Uses the FreeImageIO structure to identify a bitmap type | |
Unicode version of GetFileType | |
Returns the string that was used to register a plugin from the system assigned FREE_IMAGE_FORMAT. | |
Like up | |
Return the bitmap height | |
Return the image type | |
Alias for GetInfoHeader | |
Returns a pointer to the BITMAPINFOHEADER of the DIB-element in a FIBITMAP. | |
Return the current library isntance. | |
Returns the width of the bitmap in bytes. | |
Returns an array of page-numbers that are currently locked in memory. | |
Return metadata | |
Return how many pages are present into this bitmap | |
Return a pointer to a palette struct | |
Returns the width of the bitmap in bytes, rounded to the next 32-bit boundary, also known as pitch or stride or scan width. | |
Get the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access). | |
Return the pixel index for the bitmap, default return the first at left top | |
Like up | |
Returns a pointer to the start of the given scanline in the bitmap s data-bits. | |
Returns the number of components in the tag (in tag type units). | |
Returns the tag description if available, returns NULL otherwise. | |
Returns the tag field name (unique inside a metadata model). | |
| |
Return the datatype | |
Return the tag value | |
Return the value of the key passed | |
Returns the number of transparent colors in a palletised bitmap | |
Returns a pointer to the bitmap s transparency table. | |
Returns a string containing the current version of the DLL. | |
Return the bitmap width | |
Returns TRUE when the image has a file background color | |
Initialises the library. | |
Inserts a new page before the given position in the bitmap. | |
Inverts each pixel data | |
This function returns TRUE if the platform running FreeImage uses the Little Endian convention | |
Return if the fileName passed is a multipage file the number of page is returned | |
Returns TRUE when the plugin is enabled, FALSE when the plugin is disabled, -1 otherwise. | |
Returns TRUE when the transparency table is enabled | |
This function decodes a bitmap, allocates memory for it and then returns it as a FIBITMAP. | |
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 | |
Load an image from a buffer | |
Load an image from an open python file object. | |
This function is the handle version of Load. | |
Same of Load. | |
Lock and return a locked bitmap into a multipage bitmap | |
| |
Moves the source page to the position of the target page. | |
Simple mthod for open multibitmap page | |
flags is to enable or disable a feature into a plugin | |
Alpha blend or combine a sub part image with the current dib image. | |
Registers a new plugin to be used in FreeImage. | |
Registers a new plugin to be used in FreeImage. | |
Return the bitmap rescaled with the parameter passed | |
Rotate the bitmap and return a new bitmap | |
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. | |
This function saves a previously loaded FIBITMAP to a file. | |
Save an image from an open python file object. | |
This function saves a previously loadaed FIBITMAP to a file handle. | |
Same of Save. | |
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 | |
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 | |
Insert a 8-bit dib into a 24- or 32-bit image. | |
Set the real or imaginary part of a complex image (image whose type is FIT_COMPLEX). | |
Return the bitmap DPIs | |
Set the horrizontal resolution | |
Set the vertical resolution | |
Set the pixel color of a 16-, 24- or 32-bit image at position (x, y), including range check (slow access). | |
Set the pixel index of a palettized image at position (x, y), including range check (slow access). | |
Enables or disables a plugin. | |
Set the bitmap s transparency table. | |
Converts a FreeImage tag structure to a string that represents the interpreted tag value. | |
Converts a bitmap to 1-bit monochrome bitmap using a threshold T between [0..255]. | |
Deletes a previously loaded FIBITMAP from memory. | |
UnLock a page into a multipage bitmap if modified, the engine update the bitmap with that passed | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
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)
Costrunct class
|
__del__(self)
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
|
clone(self)Clone the current bitmap
|
close(self)Close the loaded bitmap |
convertToMinIsWhite(self, invert=True)Convert the current bitmap to MINISWHITE.
|
convertToPages(self, fileOut, extType=None)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=False)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=None, flag=0, unloadPrev=True)Load a buffer and (try) to convert it to a dib.
|
GetBackgroundColor(self)Return the background color, if any. Otherwise I'll return 0
|
getBitmap(self)Return the current bitmap dib
|
getBPP(self)Get the bpp (size of one pixel in the bitmap in bits)
|
getBuffer(self, close=0, topdown=False)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
|
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=True, try_multiPage=True)Load the filename
|
loadFromBitmap(self, bitmap, unloadPrev=True)Load an already loaded bitmap. Useful when you have to use some functions that this class hasn't bind.
|
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
|
ok(self)Return if the bitmap and its associated library istance status
|
paste(self, bitmap, box=None, alpha=255)Paste an image passed into this image
|
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.
|
rotate(self, angle, inplace=False)Rotate the bitmap and return the new one if inplace are False
|
save(self, fileName, type=None, flags=False)Save the current already loaded bitmap
|
seek(self, page=0)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=0)Set the current page number. If yor seek outside the image sequens, raise EOFError
|
setSize(self, size, filter=3, inplace=True)Property size method
|
setUnloadWhenDel(self, value)Set the unloadWhenDel attribute
|
tell(self)Tell method
|
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
|
bitmap |
bpp |
currentPage
|
filename
|
format
|
histogram
|
metadata
|
numPages
|
size |
status
|
transparent
|
unloadWhenDel
|
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Fri Nov 17 12:52:34 2006 | http://epydoc.sf.net |