image->save

Saves an image.

Target member

Signature

1image->save(path::string, -quality::integer= ?)

Saves an image.

image->save is called with member syntax on a receiver value. image->save works with structured document or media data. Keep parsing, transformation, and output steps separate enough that each step can be checked on its own.

Parameters

path
Required value of type string. Supply path positionally unless the signature shows a keyword form.
-quality
Optional value of type integer. Supply -quality by keyword, keeping the leading hyphen in the call.

Examples

Basic call

1image('/tmp/photo.jpg')->save('/tmp/photo.png')
The example shows the normal call shape. Adapt variable names, validation, and surrounding error handling to the context.