Reading and Writing Methods

GD was originally designed to handle files in the GIF format, but has been modified to read and write more flexible formats such as PNG and JPEG instead. Additional methods are available to read X Bitmap files and read and write files in the uncompressed GD file format. Image reading and writing can be done through the use of filehandles, which allows for a great deal of flexibility in managing the flow of image data. It is simple to write an image to a file or STDOUT, or to pipe image data between processes.

The following methods are available from the GD::Image class for reading images.

Get Perl Graphics Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.