IFF_PNG | R Documentation |
pixWrite
creates a file containing the image in the Pix
.
The code uses the leptonica library and, depending on how it was
installed, it has support for numerous image formats.
The IFF (ImageFileFormat) variables are symbolic constants used to identify different image
file formats. We use them in pixWrite
to indicate the
desired file format for the image being written.
These are better than strings, e.g. "PNG", or simple numbers, e.g. 3.
However, one can use either of these forms also. However, IFF_PNG
is preferred to "PNG" and both are much preferred to 3.
pixWrite(pix, file, format = guessImageFormatByExt(file))
pix |
the |
file |
the name of the file to which the image will be written. |
format |
the file format to use. By default, we attempt to guess
the format from the extension on the |
Leptonica imageio.h heade file.
pixWrite
## Not run:
f = system.file("images", "DifferentFonts.png", package = "Rtesseract")
p = pixRead(f)
pixWrite(p, "foo.webp", IFF_WEBP)
pixWrite(p, "foo.tiff", IFF_TIFF_LZW)
pixWrite(p, "foo.webp", "WEBP")
pixWrite(p, "foo.tiff", "TIFF_LZW")
pixWrite(p, "foo.webp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.