ruby-libgd

GD::Image#save

Saves the image to disk. The output format is inferred from the file extension.

Signature

save(path, options = nil)

Supported formats

| Extension | Backend | |———–|———| | .png | PNG with alpha | | .jpg, .jpeg | JPEG (quality supported) | | .webp | WebP |

Options

Examples

img.save("map.png")
img.save("photo.jpg", quality: 80)
img.save("tile.webp")

Errors

Raises ArgumentError for unsupported extensions.