resource freeimage_load(string filename [, int flags])
Decodes a bitmap, allocates memory for it and then returns it as a FIBITMAP.
bool freeimage_save(resource bitmap, string filename [, int flags])
Saves a previously loaded FIBITMAP to a file.
void freeimage_unload(resource bitmap)
Deletes a previously loaded FIBITMAP from memory.
resource freeimage_clone(resource bitmap)
Makes an exact reproduction of an existing bitmap.
string freeimage_getversion()
Returns a string containing the current version of the DLL.
string freeimage_getcopyrightmessage()
Returns a string containing a standard copyright message.
string freeimage_getlasterror()
Returns the last error message.
int freeimage_getimagetype(resource bitmap)
Returns the data type of a bitmap.
int freeimage_getcolorsused(resource bitmap)
Returns the number of colors used in a bitmap. This function returns the palette-size for palletised bitmaps, and 0 for high-colour bitmaps.
int freeimage_getbpp(resource bitmap)
Returns the size of one pixel in the bitmap in bits. Possible bit depths are 1, 4, 8, 16, 24, 32, 64 and 128.
int freeimage_getwidth(resource bitmap)
Returns the width of the bitmap in pixels.
int freeimage_getheight(resource bitmap)
Returns the height of the bitmap in pixels.
int freeimage_getline(resource bitmap)
Returns the width of the bitmap in bytes.
int freeimage_getpitch(resource 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.
int freeimage_getdibsize(resource bitmap)
Returns the size of the DIB-element of a FIBITMAP in memory, i.e. the BITMAPINFOHEADER + palette + data bits.
int freeimage_getfiletype(string filename [, int size])
Returns one of the predefined FREE_IMAGE_FORMAT constants or a bitmap identification number registered by a plugin.
int freeimage_getfifcount()
Retrieves the number of FREE_IMAGE_FORMAT identifiers being currently registered.
bool freeimage_setpluginenabled(int fif [, bool enable])
Enables or disables a plugin.
bool freeimage_ispluginenabled(int fif)
Returns TRUE when the plugin is enabled, FALSE when the plugin is disabled, -1 otherwise.
int freeimage_getfiffromformat(string format)
Returns a FREE_IMAGE_FORMAT identifier from the format string that was used to register the FIF.
int freeimage_getfiffrommime(string mime)
Returns a FREE_IMAGE_FORMAT identifier from a MIME content type string (MIME stands for Multipurpose Internet Mail Extension).
string freeimage_getformatfromfif(int fif)
Returns the string that was used to register a plugin from the system assigned FREE_IMAGE_FORMAT.
string freeimage_getfifextensionlist(int fif)
Returns a comma-delimited file extension list describing the bitmap formats the given plugin can read and/or write.
string freeimage_getfifdescription(int fif)
Returns a descriptive string that describes the bitmap formats the given plugin can read and/or write.
string freeimage_getfifregexpr(int fif)
Returns a regular expression string that can be used by a regular expression engine to identify the bitmap.
int freeimage_getfiffromfilename(string filename)
Returns the plugin that can read/write files with that extension in the form of a FREE_IMAGE_FORMAT identifier.
bool freeimage_fifsupportsreading(int fif)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to load bitmaps, FALSE otherwise.
bool freeimage_fifsupportswriting(int fif)
Returns TRUE if the plugin belonging to the given FREE_IMAGE_FORMAT can be used to save bitmaps, FALSE otherwise.
resource freeimage_rotate(resource bitmap, double angle)
Rotates an 8-bit greyscale, 24- or 32-bit image by means of 3 shears.
resource freeimage_rotateex(resource bitmap, double angle, double x_shift, double y_shift, double x_origin, double y_origin, bool use_mask)
Performs a rotation and / or translation of an 8-bit greyscale, 24- or 32-bit image, using a 3rd order (cubic) B-Spline.
bool freeimage_fliphorizontal(resource bitmap)
Flip the input bitmap horizontally along the vertical axis.
bool freeimage_flipvertical(resource bitmap)
Flip the input bitmap vertically along the horizontal axis.
mixed freeimage_rescale(resource bitmap, int dst_width, int dst_height, int filter)
Performs resampling (or scaling, zooming) of a 8-, 24- or 32-bit image to the desired destination width and height.
bool freeimage_gamma(resource bitmap, double gamma)
Performs gamma correction on a 8-, 24- or 32-bit image. The function returns TRUE on success. It returns FALSE when gamma is less than or equal to zero or when the bitdepth of the source bitmap cannot be handled.
bool freeimage_brightness(resource bitmap, double percentage)
Adjusts the brightness of a 8-, 24- or 32-bit image by a certain amount. This amount is given by the percentage parameter, where percentage is a value between [-100..100]. A value 0 means no change, less than 0 will make the image darker and greater than 0 will make the image brighter. The function returns TRUE on success, FALSE otherwise (e.g. when the bitdepth of the source bitmap cannot be handled).
bool freeimage_contrast(resource bitmap, double percentage)
Adjusts the contrast of a 8-, 24- or 32-bit image by a certain amount. This amount is given by the percentage parameter, where percentage is a value between [-100..100]. A value 0 means no change, less than 0 will decrease the contrast and greater than 0 will increase the contrast of the image. The function returns TRUE on success, FALSE otherwise (e.g. when the bitdepth of the source bitmap cannot be handled).
bool freeimage_invert(resource bitmap)
Inverts each pixel data.
mixed freeimage_copy(resource bitmap, int left, int top, int right, int bottom)
Copy a sub part of the current bitmap image and returns it as a FIBITMAP*. The function returns the subimage if successful, NULL otherwise.
mixed freeimage_parse(resource dst, resource src, int left, int top, int alpha)
Alpha blend or combine a sub part image with the current bitmap image. The function returns TRUE if successful, FALSE otherwise.
resource freeimage_composite(resource fg [, bool usefilebkg [, mixed bkcolor [, resource bg]]])
This function composite a foreground image against a single background color or against a background image.
resource freeimage_convertto8bits(resource bitmap)
Converts a bitmap to 8 bits. If the bitmap was a high-color bitmap (16, 24 or 32-bit) or if it was a monochrome or greyscale bitmap (1 or 4-bit), the end result will be a greyscale bitmap, otherwise (1 or 4-bit palletised bitmaps) it will be a palletised bitmap.
resource freeimage_convertto16bits555(resource bitmap)
Converts a bitmap to 16 bits, where each pixel has a color pattern of 5 bits red, 5 bits green and 5 bits blue. One bit in each pixel is unused.
resource freeimage_convertto16bits565(resource bitmap)
Converts a bitmap to 16 bits, where each pixel has a color pattern of 5 bits red, 6 bits green and 5 bits blue.
resource freeimage_convertto24bits(resource bitmap)
Converts a bitmap to 24 bits.
resource freeimage_convertto32bits(resource bitmap)
Converts a bitmap to 32 bits.
resource freeimage_colorquantize(resource bitmap, int quantize)
Quantizes a high-color 24-bit bitmap to an 8-bit palette color bitmap.
resource freeimage_threshold(resource bitmap, int threshold)
Converts a bitmap to 1-bit monochrome bitmap using a threshold T between [0..255].
resource freeimage_dither(resource bitmap, int algorithm)
Converts a bitmap to 1-bit monochrome bitmap using a dithering algorithm.
resource freeimage_openmultibitmap(int fif, string filename, bool create_new, bool read_only [, bool keep_cache_in_memory])
Opens a multi-paged bitmap.
bool freeimage_closemultibitmap(resource multibitmap [, int flags])
Closes a previously opened multi-page bitmap and, when the bitmap was not opened read-only, applies any changes made to it.
int freeimage_getpagecount(resource multibitmap)
Returns the number of pages currently available in the multi-paged bitmap.
void freeimage_appendpage(resource multibitmap, resource bitmap)
Appends a new page to the end of the bitmap.
void freeimage_insertpage(resource multibitmap, int page, resource bitmap)
Inserts a new page before the given position in the bitmap. Page has to be a number smaller than the current number of pages available in the bitmap.
void freeimage_deletepage(resource multibitmap, int page)
Deletes the page on the given position.
resource freeimage_lockpage(resource multibitmap, int page)
Locks a page in memory for editing. The page can now be saved to a different file or inserted into another multi-page bitmap.
void freeimage_unlockpage(resource multibitmap, resource bitmap, bool changed)
Unlocks a previously locked page and gives it back to the multi-page engine. When the last parameter is TRUE, the page is marked changed and the new page data is applied in the multi-page bitmap.
bool freeimage_movepage(resource multibitmap, int target_page, int source_page)
Moves the source page to the position of the target page. Returns TRUE on success, FALSE on failure.
int freeimage_getlockedpagenumbers(resource multibitmap, int pages, int count)
Returns an array of page-numbers that are currently locked in memory. When the pages parameter is NULL, the size of the array is returned in the count variable. You can then allocate the array of the desired size and call FreeImage_GetLockedPageNumbers again to populate the array.